EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09436


< 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 convert metadata input from a radio button to a checkbox


Hi Fiza,

You will need to add the "multiple => 1," attribute to the field definition.  However, I would advise doing this first on a test or pre-production server of your EPrints repository as it will require modifying the the database.  There should generally be no problem with such a database change but if it turns out not to make the change you want then changing and then reverting the database change has some small inherent risk of data loss/corruption.

As this looks to be a bespoke field, it may have been added to your archive's eprint_fields.pl but it may have been added elsewhere.  You should be able to find eprints_fields.pl or another configuration files this field has been added to under the following path (substituting EPRINTS_PATH and ARCHIVE_ID as appropriate):

EPRINTS_PATH/archives/ARCHIVE_ID/cfg/cfg.d/

As you have made the field into a multiple, you will need to update the database so this goes from being a column in a database table to its own database table using the following command (again substituting placeholders):

EPRINTS_PATH/bin/epadmin update ARCHIVE_ID

Once done you will need to reload your webserver (e.g. apachectl graceful) and EPrints indexer.  The latter of these can be done from the Admin menu of the web interface.

For further information see the wiki page about set fields [1].  If this field is not of type set it will be a sub-type of this field and therefore the configuration is still applicable.

Regards

David Newman
[1] https://wiki.eprints.org/w/Set_field


On 26/09/2023 4:42 am, Noorhafizah Mohd Akil wrote:
CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.
Hello, I'm Fiza. I hope your team could assist me in resolving this matter. I am new to using EPrints EPRINTS RELEASE: 3.3.15, and this metadata  (MyRA Type) has already been created by the IT person back in 2016. I need to convert this metadata input from a radio button to a checkbox, so users can choose more than one MyRA Type.
image.png

The question is, how can I achieve this? Also, does changing the input type from a radio button to a checkbox, also require modifications to the database table structure as well?


Below is the design table for the EPrints table in the database:
image.png

And below are the phrases edited in the config file:
image.png

Thank you in advance.


*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/