• Resolved dashart

    (@dashart)


    Hi,
    thanks for this great plugin.

    (But) I have discovered a bug:
    1) I create a loop
    2) I create inside this loop a field with type “hyperlink”
    3) I update the settings

    4) I open / create a post
    5) I add a row
    6) I add a hyperlink to this row with URL and Link Text
    7) I save the post

    What happens:
    If I open the post again, the hyperlink exists still in the loop.
    But URL and Link Text are empty.

    What should happen:
    URL and Link Text should not be empty

    Additional note:
    If I switch the field type, the field value is:
    a:2:{i:0;a:1:{s:3:"url";s:16:"http://ww.web.de";}i:1;a:1:{s:4:"text";s:10:"test title";}}

    A fix for this would be great 😉

    http://wordpress.org/plugins/custom-field-suite/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dashart

    (@dashart)

    Okay “dirty” workaround for the backend:
    In hyperlink.php (from Plugin “CFS – Hyperlink Add-on”)
    added at line 24:

    // if field is used in a row ... we got each param with an array around
    // so $field->value[0]['url'] and $field->value[1]['text']
    if( empty($field->value['url']) && empty($field->value['text'])
            && !empty($field->value[0]['url']) && !empty($field->value[1]['text']) ) {
         $field->value[0]['text'] = $field->value[1]['text'];
        $field->value = $field->value[0];
    }

    But frontend not working:

    $links = $cfs->get("external_links");
    var_dump($links);

    returns only:
    array(2) { [1]=> array(1) { ["external_link"]=> string(0) "" } [2]=> array(1) { ["external_link"]=> string(0) "" } } array(1) { ["external_link"]=> string(0) "" } array(1) { ["external_link"]=> string(0) "" }

    Plugin Author Matt Gibbs

    (@mgibbs189)

    Thanks, I’ll check to see if it’s compatible with Loop fields.

    Plugin Author Matt Gibbs

    (@mgibbs189)

    Closing; this is on the Github roadmap and also posted on the plugin support forums: https://uproot.us/forums/questions/1656/loop-hyperlink-empty-input-after-save

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘loop hyperlink = empty input after save’ is closed to new replies.