• Resolved norbou

    (@norbou)


    Hey, David,
    My WordPress theme Enfold adds a special Copyright field to each media and it is available through the standard media editing screen. I found that the field is called av_copyright_field. Can I set the image metadata mapping to this field?
    Unfortunately, the field name doesn’t show up in the Add New Custom Field Rule menu and when I just type it in, it doesn’t work.

    According to the theme documentation, the field is handled as follows:
    $form_fields[‘av_custom_field’] = array(
    ‘label’ => __(‘Custom Field’),
    ‘input’ => ‘text’,
    ‘value’ => get_post_meta( $post->ID, ‘_avia_attachment_custom_field’, true ),
    );

    Current configuration:
    av_copyright_field
    IPTC Value: 2#116 copyright-notice
    EXIF/Template Value: template:([+exif:Copyright]}
    Priority: EXIF
    Existing Text: Keep
    Status Active
    Delete NULL Values
    Format Native
    Option Text

    Thank you for your support,
    Jiri

    • This topic was modified 2 years, 3 months ago by norbou.
    • This topic was modified 2 years, 3 months ago by norbou.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for posting all the details of what you’ve tried and the mapping rule you created.

    I think the solution will be straightforward. If you look carefully at the field name you will see it starts with an underscore character. WordPress uses the underscore to indicate “hidden” custom fields, which is why the field does not show up in the dropdown list of the Add New Custom Field menu. If you enter the field name manually and include the leading underscore, i.e., enter _av_copyright_field it should work.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the proposed solution. Thanks for your interest in the plugin.

    Thread Starter norbou

    (@norbou)

    Thanks for the tip and explanation, I had no idea.
    I tried with the underscore at the beginning, but that doesn’t work either, although the data is in the image and I can see it in the MLA meta box below the image.
    So there is nothing to do, it just won’t work.

    Regards,
    Jiri

    Plugin Author David Lingren

    (@dglingren)

    Let’s not give up just yet.

    You can try changing the Existing Text: Keep setting to Existing Text: Replace. That would help if the existing value in the field is not empty.

    There is a small problem in your EXIF/Template Value. You posted template:([+exif:Copyright]}. There’s a missing plus sign at the end. It should be template:([+exif:Copyright+]}. Check your original rule source text to verify the template.

    You can try changing the field name to see if the rule is working as you expect. For example, when you tried av_copyright_field (without the underscore) did the rule create a custom field of that name? If it did, the problem is with the underscore (unlikely) or because the existing field is not empty.

    If you do end up with values stored under a different field name you can delete them with the rule’s “Purge Values” rollover action.

    Let me know if the above suggestions are helpful. If you still have trouble you can activate some debug logging to see if it yields any clues:

    To activate MLA’s debug logging:

    1. Navigate to the Settings/Media Library Assistant Debug tab.
    2. Scroll down to the “MLA Reporting” text box and enter “0x13”. This will turn on MLA debug logging for AJAX operations and the IPTC/EXIF metadata mapping rules.
    3. Click the Save Changes button to record your new setting.
    4. Optionally, scroll to the bottom of the screen and click “Reset” to clear the error log. You may not want to do this depending on how you manage your error log.

    Once that’s done you can run a test. The debug log will be very detailed, so restricting the test as best you can will be very helpful. For example, try running the rule on a single item using the “Map IPTC/EXIF Metadata” link on the Media/Edit Media screen.

    When you’ve finished testing, go back to the Debug screen and:

    1. Enter “0” in the MLA Reporting text box to turn debug logic off.
    2. Click the Save Changes button to record your new setting.
    3. Scroll to the bottom and click “Download” to get the log content in a text file.

    There should be a lot of messages written to the log, so limit the amount of activity during the logging period. You should see messages in the log like these:

    [27-Jun-2020 23:09:30 UTC] 610 MLACore::mla_plugins_loaded_action() MLA 2.83 (20200621) mla_debug_level 0x13
    [27-Jun-2020 23:09:30 UTC] 37 MLA_Ajax::initialize( false ) $_REQUEST = array (
    ‘action’ => ‘mla-inline-mapping-iptc-exif-scripts’,
    ‘mla_admin_nonce’ => ‘b09f9d91ed’,
    ‘bulk_action’ => ‘iptc-exif-options-map’,
    )
    

    Of course, the details will be different.

    Let me know how that goes. You can contact me at my web site for instructions on where to send the file. Good luck.

    Thread Starter norbou

    (@norbou)

    Heureka, David,
    it works with this rule set:

    _avia_attachment_copyright
    2#116:Copyright Notice
    template:([+exif:copyright+])
    IPTC
    Keep
    Active

    Yes, I had a typo there, but after further searching on the Enfold template support forum I found another mention of this field and it what is the exact name. For those of you using this template, here’s what to do with it:
    https://kriesi.at/support/topic/how-to-use-the-image-copyright-info-within-a-enfold-gallery/

    Thank you very much for your help,
    Jiri

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Copyright metada mapping to _avia_attachment_custom_field’ is closed to new replies.