EPrints Technical Mailing List Archive

Message: #08294


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] How to remove a sub field from a compound field?


Hi Dennis,

I am not I am not exactly sure where metafield.pl would have come from it is not a field that is in the standard EPrints codebase for 3.3 or 3.4.  However, zz_webcfg_eprint_fields.pl will have been created by someone adding a MetaField from the Manage Metadata Fields page accessible from tha Admin menu's Config tools tab.  This is why there would also likely to be data about this field in the mf_* tables in the database.

Manage Metadata Fields is designed to provide a way for non-sysadmins to add additional fields they might need for a data object.  Obviously, you would want to keep this separate from main configuration for eprint fields in your archive's cfg/cfg.d/eprint_fields.pl, so there is a clear delineation between changes made from the command line and changes made in the web interface.  Similarly if you add or edit phrases in the Phrase Editor this will create/amend a cfg/lang/en/phrases/zz_webcfg.xml in your archive.

I have tried adding a MetaField for the eprint data object from the Manage Metadata Fields interface and this only created modifed the following files in the archive:

./var/last_changed.timestamp
./cfg/lang/en/phrases/zz_webcfg.xml
./cfg/workflows/eprint/default.xml
./cfg/cfg.d/zz_webcfg_eprint_fields.pl

It does does not result in the creation ofanywhere (I ran updatedb and then locate across the whole filesystem) of metadata.pl (or metadata.xml) so I have really no idea where they can from.  Please could you provide me with the full path of these files, as this may help me get a better idea of where they have come from.

Regards

David Newman

On 06/08/2020 08:47, Dennis - UT wrote:
Hi David,

I found the solution. There was also a file called
zz_webcfg_eprint_fields.pl in the cfg.d folder which contained nearly
the same content as metafield.pl in var. I also removed the field from
that file and now the field is gone.

Why actually are these fields defined in two nearly identical Perl
files? The only difference seems to be that one contains a field
"provenance" and the other uses "providence" for the same field.
Additionally these fields are also defined in metafield.xml.

We started with EPrints before the webcfg fields were invented. Later
on we used the webcfg to define some fields. After a while however we
switched back to eprints_fields.pl as that seemed easier to maintain.

Dennis
University of Twente - NL

On Wed, Aug 5, 2020 at 7:26 PM Dennis - UT via Eprints-tech
<eprints-tech@ecs.soton.ac.uk> wrote:
Hi David,

Thanks for the reply!

It's a custom field on the eprint data object. I already removed the
subfield from all of the mentioned files. Is field information also
stored or cached elsewhere? I saw some references in mf* tables, but
removing those also didn't work.

Dennis
University of Twente - NL

On Tue, Aug 4, 2020 at 5:56 PM David R Newman <drn@ecs.soton.ac.uk> wrote:
Hi Dennis,

Assuming you want to remove a sub-field from the eprint data object
(dataobj) and you are running at least EPrints 3.3.x then you would need
to edit the field in eprint_fields.pl under
archives/ARCHIVE_NAME/cfg/cfg.d/ to remove the sub-field from the
compound field*.  If you cannot find the field in here see if you can
find the field somewhere else in the cfg.d/ directory.  If it is a
compound field you will probably not need to remove this sub-field from
cfg/workflows/eprint/default.xml but you may need to remove it from
citations in cfg/citations/eprint/.

Generally, I advise against removing fields using epadmin remove_field,
just in case you decide you want to reinstate it later, if you have
remove it from all the places it is included (eprint_fields.pl,
workflows and possibly citations and eprints_render.pl and other cfg.d
files).  This should mean that EPrints forgets about the field and you
shouldn't get any errors from EPrints trying to find a field that is no
longer defined.

Regards

David Newman

*If you are trying to remove a sub-field for a core field on the data
object you may not be able to do this by editing one of the config
files.  Instead you will need to edit perl_lib/EPrints/DataObj/Eprint.pm
or whatever data objects you are dealing with.

On 04/08/2020 15:45, Dennis - UT via Eprints-tech wrote:
Hi,

Does anyone know how to remove a sub field from a compound field? I
removed the field from metafields.xml and metafields.pl. I also
removed any reference to it from other files in the archive cfg
folder, followed by a restart. This doesn't make the field disappear
however.

I tried epadmin remove_field on the subfield. This does delete the DB
table, but the sub field is still in the UI. If I run epadmin update
afterward, it just adds the table back.

Somehow somewhere it still remembers the sub field.

How can I completely remove the sub field?

Thanks!

Dennis
University of Twente - NL
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7C%7C5dda6b61d5c44fba422308d839e09d61%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=VhIQ5Epx1PDYQeyewKDzC9YZtNGE%2BiaJd%2FNkhDibZWI%3D&amp;reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7C%7C5dda6b61d5c44fba422308d839e09d61%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=DfVpSqQlVSwFFM%2FjHneBDSgykRLKsdXv3SY%2BnzkldG4%3D&amp;reserved=0
--
This email has been checked for viruses by AVG.
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avg.com%2F&amp;data=01%7C01%7C%7C5dda6b61d5c44fba422308d839e09d61%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=SuCAQZq56Ei%2B%2BYtLRCXlVmd%2BO4tTf2yy4BQp488r5J8%3D&amp;reserved=0

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7C%7C5dda6b61d5c44fba422308d839e09d61%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=VhIQ5Epx1PDYQeyewKDzC9YZtNGE%2BiaJd%2FNkhDibZWI%3D&amp;reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7C%7C5dda6b61d5c44fba422308d839e09d61%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=DfVpSqQlVSwFFM%2FjHneBDSgykRLKsdXv3SY%2BnzkldG4%3D&amp;reserved=0

--
This email has been checked for viruses by AVG.
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avg.com%2F&amp;data=01%7C01%7C%7C5dda6b61d5c44fba422308d839e09d61%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=SuCAQZq56Ei%2B%2BYtLRCXlVmd%2BO4tTf2yy4BQp488r5J8%3D&amp;reserved=0