Menu

#70 cannot POST extraParams on XOOPS Comment integration

2.1.4
closed-fixed
minahito
Legacy (179)
7
2008-08-30
2007-08-22
mantaRay
No

In the module using a XOOPS Comment function, post of a comment causes a fatal error.
This module passes extraparams to the XOOPS side.

The definition of xoops_version.php is as follows.
//****************************************************************/
// Comments
$modversion['hasComments'] = 1;
$modversion['comments']['itemName'] = 'xoops_imageid';
$modversion['comments']['pageName'] = 'view_photo.php';
$modversion['comments']['extraParams'] = array('albumName', 'id');
//****************************************************************/

This problem is caused by XC Legacy 2.1.1, but not caused by Xoops 2.0.16a JP.
The value of extraparams need to be embedded at 'hidden' of HTML_FORM in the stage which opened the comment_new screen.
When a comment screen is opened, this value is set in Xoops 2.0.16a JP but not set in XC Legacy 2.1.1.

In the case of Xoops 2.0.16a JP:
//*******************************************************************************/
<form name='commentform' id='commentform' action='comment_post.php'
method='post' onsubmit='return xoopsFormValidate_commentform();'>
......
<input type='hidden' name='albumName' id='albumName' value='album01' />
<input type='hidden' name='id' id='id' value='01_G' />
......
</form>
//*******************************************************************************/

The value (albumName & id) is set correctly.
It's right.

In the case of XC Legacy 2.1.1:
//*******************************************************************************/
<form action="comment_post.php" method="post">
......
<input name="com_exparams" id="legacy_xoopsform_com_exparams" type="hidden" />
......
</form>
//*******************************************************************************/

The value is not set correctly but is blank.
It is not right.

Discussion

  • minahito

    minahito - 2007-09-09

    Logged In: YES
    user_id=1102607
    Originator: NO

    This bug may be the same cause as #1779754.

     
  • minahito

    minahito - 2007-09-09
    • status: open --> open-duplicate
     
  • okuhiki

    okuhiki - 2007-09-12

    Logged In: YES
    user_id=1774907
    Originator: NO

    /include/comment_new.php Line 139-140
    [code]
    $extraParams = array();
    if ('system' != $xoopsModule->getVar('dirname')) {
    $comment_config = $xoopsModule->getInfo('comments');
    if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
    $myts =& MyTextSanitizer::getInstance();
    foreach ($comment_config['extraParams'] as $extra_param) {
    // This routine is included from forms accessed via both GET and POST
    if (isset($_POST[$extra_param])) {
    $hidden_value = $myts->stripSlashesGPC($_POST[$extra_param]);
    } elseif (isset($_GET[$extra_param])) {
    $hidden_value = $myts->stripSlashesGPC($_GET[$extra_param]);
    } else {
    $hidden_value = '';
    }
    $extraParams[$extra_param] = $hidden_value;
    }
    }
    }
    $renderTarget->setAttribute('extraParams', $extraParams);
    [/code]
    /html/modules/legacy/templates/legacy_comment_edit.html Line 19-20
    [code]
    <{foreach from=$extraParams key='key' item='value'}>
    <{xoops_input type='hidden' name=$key value=$value}>
    <{/foreach}>
    [/code]

     
  • minahito

    minahito - 2007-09-13
    • priority: 5 --> 7
    • assigned_to: nobody --> minahito
    • milestone: --> 731538
    • status: open-duplicate --> open-accepted
     
  • minahito

    minahito - 2007-09-13

    Logged In: YES
    user_id=1102607
    Originator: NO

    Thanks okuhiki! Nice patch!

    I got to understand what this bug is.

     
  • minahito

    minahito - 2007-09-15

    Logged In: YES
    user_id=1102607
    Originator: NO

    I did not fix this bug in 2.1.2, because I could not keep enough time to work this. This bug will be fixed in 2.1.3.

     
  • minahito

    minahito - 2008-08-30
    • milestone: 731538 --> 2.1.4
    • status: open-accepted --> closed-fixed
     
  • minahito

    minahito - 2008-08-30

    Logged In: YES
    user_id=1102607
    Originator: NO

    Fixed at 2.1.4.

     

Log in to post a comment.

MongoDB Logo MongoDB