1. Jaime
  2. Bug Report
  3. Friday, 31 July 2009
  4.  Subscribe via email
Hello....

when the posts need to be approved by an administrator, no messages appear because published is 0. This fact causes posting to fail with this error appearing in the text area:


<br />
<b>Notice</b>: Undefined index: id in <b>F:Web SitesPHPHagaloUstedMismoWebcomponentscom_commentjoscommentcomment.class.php</b> on line <b>1205</b><br />
<?xml version="1.0" standalone="yes"?><post><id></id><published></published><noerror>1</noerror><debug></debug><captcha><![CDATA[<a title="clic para recargar una nueva imagen" href='javascript:JOSC_reloadCaptcha()'><img src="http://hagaloustedmismo//components/com_comment/joscomment/captcha.php?refid=7066633b2c8559175caa7758efa61049" alt="Security Image" />
<input type="hidden" name="security_refid" value="7066633b2c8559175caa7758efa61049" /></a>]]></captcha></post>


This is due to the following code:


if ($ajax) {
$data = $this->getComments(true);
$after = -1;
/* look for the right place */
foreach($data as $item) {
if ($item['id'] == $this->_comment_id) {
$item['after'] = $after;
$item['view'] = $published;
$item['debug'] = $debug;
$item['noerror'] = 1;
return $item;
}
$after = $item['id'];
}
$data[0]['view'] = $published;
$data[0]['debug'] = $debug;
$data[0]['noerror'] = 1;
return $data[0];
} else return $published;


Since there is no comment published, $data variable is empty, so that $data[0] doesn't contain the id index.

To solve it, I added an if sentence at line 1204 of comment.class.php:


if (isset($item['id']))
$xml .= '<id>' . $item['id'] . '</id>';


I don't know if this is the right solution, but it works :)

Cheers
Responses (3)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Language parameter in the link to the comment
Hello. 1) I have a multilingual website (3 languages). If someone added a comme...
1 Replies
Posted on Saturday, 06 April 2024
categories icon in header
Hi! I saw this in the promo, but I can't find how to set it up. https://compo...
0 Replies
Posted on Monday, 22 April 2024
  • New
    • #style
    • #Categories
    Questions on new installation...
    Working on getting this set up... https://eastend2024.joepolecheck.com/rumma...
    3 Replies
    Posted on Wednesday, 17 April 2024
  • Resolved
  • New
  • Changes to the Submission form
    Can you make changes to the Submission form? There are a few fields I'd like to ...
    0 Replies
    Posted on Thursday, 18 April 2024
  • New
  • Error received? Class "XMLReader" not fo
    Just installed the Pro version of Hotspots, but am getting an error when I try t...
    1 Replies
    Posted on Wednesday, 17 April 2024
  • Resolved
  • New