1.4.6 adress fields with comment_form and register_user ?

vincent3569 Member, Translator
Hi

can you explain to these adress fields are supposed to work with comment_form and register_user ?

there are adress_fields options (omit, show, require), for the two plugins.
but on register_user plugin options, there is this note
Address fields are handled by the comment_form plugin.
but even if adress_fields are required on the two plugin, adress fields are not displayed on register page...

the only way to have adress fields on register page, is to enable another plugin : userAddressFields.

but even if, this plugin is not allowed, adress fields are displayed on comment form.

it is completely incomprehensible...

Comments

  • The comment is obsolete, but for the 1.4.5 release it was correct. What makes you think that an extension must be enabled for its features to be used by another plugin or admin feature?

    It is quite common for us to use plugins even if not enabled. This is an effective way to share code. For instance, the admin pages use the `tagg_suggest` plugin (enabled or not) for suggesting tags on the back end. No need to implement a parallel structure to do this when it already exists. In the above case, the address handling has been removed to the new `userAddressField` plugin.
  • vincent3569 Member, Translator
    What makes you think that an extension must be enabled for its features to be used by another plugin or admin feature?
    in admin>options>register_user, behind adress fields options, you have this note :
    `Note: Address fields are handled by the comment_form plugin.`

    what does-it mean ?
    It is quite common for us to use plugins even if not enabled. This is an effective way to share code.[...]In the above case, the address handling has been removed to the new userAddressField plugin.

    Of course I agree to sharing some code.
    But in my case, what option is supposed to be used to display adress fields ? it's realy not clear for users of zenphoto, don't you think ?
  • acrylian Administrator, Developer
    I haven't looked at the code yet but I supposed that note is probably just a forgotten update. As there is now a separate plugin in 1.4.6.
  • vincent3569 Member, Translator
    as far I can understand :

    there is two different behaviors :
    - comment_form plugin:
    if you check 'show' or 'require' for adress_fields options, adress fields are displayed in comment form, even if userAddressField plugin is not enabled.

    - register_user plugin:
    if you check 'show' or 'require' for adress_fields options, you have to enable userAddressField plugin to see them in register page.

    according to me, it should be a common behavior (maybe the 2nd one).

    with this 2nd behavior, it should a notice in admin>options>plugins mentionning something like:
    Address fields are handled by the userAddressField. you have to enable this plugin if 'show' or 'require' options are checked.

    Finally, I do not understand the usefulness of this code in zp-core/zp-extentions/register_user/register_user_form.php, lines 91 to 113 :

    `
    $html = zp_apply_filter('register_user_form', '');
    if (!empty($html)) {
    $rows = explode('', $html);
    foreach ($rows as $row) {
    if (!empty($row)) {
    $row = str_replace('', '', $row);
    $elements = explode('', $row);
    $col1 = trim(str_replace(array('', ':'), '', $elements[0]));
    if (count($elements) == 1) { // new style form
    echo $col1;
    } else { // old table style form
    $col2 = str_replace('size="40"', 'size="' . TEXT_INPUT_SIZE . '"', $elements[1]);
    $col2 = str_replace('class="inputbox"', '', $input);
    ?>



    <?php echo trim(str_replace('<td>', '', $col2)); ?>

    <?php
    }
    }
    }
    }
    `
  • acrylian Administrator, Developer
    Best open a ticket then.
  • vincent3569 Member, Translator
    Stephen have done some change.
    I will test it as soon as possible.
Sign In or Register to comment.