0

I install joomla template on my localhost using wampserver but after that I got a lot of errors on the hol template as you can see on the image. the errors ae from deffernt lines and defferent files on the template and I will add all the lines here and and the code if anyone can see where is the problem I am not good with this.

line 276 here is at line 3: error: Notice: Undefined variable: sj_mar in C:\wamp\www\joomla\templates*****\html\com_k2\templates*****\item.php on line 276

<div class="itemFullText">
    <?php echo $this->item->fulltext; ?>
    <?php echo base64_decode($sj_mar); ?>
    <?php if($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0): ?>
         <!-- Item date modified -->
         <span class="itemDateModified">
              <?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('TEMPLATE_DATE_DEFAULT')); ?>
         </span>
    <?php endif; ?>
  </div>

line 73 here it is at line 3: error: Notice: Undefined variable: item in C:\wamp\www\joomla\templates\xxxx\html\xxxxxx\business.php on line 73

<div class="item-info">
                                <span class="item-date">
                                    <i class="fa fa-clock-o"></i><?php echo JHTML::_('date', $item->created, JText::_('TEMPLATE_DATE_DEFAULT')); ?>
                                </span>

                                <span class="item-comments">

                                    <?php if(!empty($item->event->K2CommentsCounter)): ?>
                                        <!-- K2 Plugins: K2CommentsCounter -->
                                        <?php echo $item->event->K2CommentsCounter; ?>
                                    <?php else: ?>
                                        <?php if($item->numOfComments>0): ?>
                                            <a class="moduleItemComments" href="<?php echo $item_first->link.'#itemCommentsAnchor'; ?>">
                                                <i class="fa fa-comments-o"></i> <?php echo $item->numOfComments; ?> <?php if($item->numOfComments>1) echo JText::_('K2_COMMENTS'); else echo JText::_('K2_COMMENT'); ?>
                                            </a>
                                        <?php else: ?>
                                            <a class="moduleItemComments" href="<?php echo $item_first->link.'#itemCommentsAnchor'; ?>">
                                                <i class="fa fa-comments-o"></i> <?php echo JText::_('TEMPLATE_THE_FIRST_TO_COMMENT'); ?>
                                            </a>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </span>
                            </div>

line 130 here is at line 10: error: Notice: Undefined property: stdClass::$numOfComments in C:\wamp\www\joomla\templates*****\html*****\trending.php on line 130

<div class="item-info">
                                <span class="item-date">
                                    <i class="fa fa-clock-o"></i> <?php echo JHTML::_('date', $item->created, JText::_('TEMPLATE_DATE_DEFAULT')); ?>
                                </span>

                                <span class="item-comments">

                                    <?php if(!empty($item->event->K2CommentsCounter)): ?>
                                        <!-- K2 Plugins: K2CommentsCounter -->
                                        <?php echo $item->event->K2CommentsCounter; ?>
                                    <?php else: ?>
                                        <?php if($item->numOfComments>0): ?>
                                            <a class="moduleItemComments" href="<?php echo $item->link.'#itemCommentsAnchor'; ?>">
                                                <i class="fa fa-comments-o"></i> <?php echo $item->numOfComments; ?> <?php if($item->numOfComments>1) echo JText::_('K2_COMMENTS'); else echo JText::_('K2_COMMENT'); ?>
                                            </a>
                                        <?php else: ?>
                                            <a class="moduleItemComments" href="<?php echo $item->link.'#itemCommentsAnchor'; ?>">
                                                <i class="fa fa-comments-o"></i> <?php echo JText::_('TEMPLATE_THE_FIRST_TO_COMMENT'); ?>
                                            </a>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </span>
                            </div>

line 83 here again the same as the error 130 line 10 error: ( ! ) Notice: Undefined variable: item in C:\wamp\www\joomla\templates*****\html******\world.php on line 83

<div class="item-info">
                                <span class="item-date">
                                    <i class="fa fa-clock-o"></i> <?php echo JHTML::_('date', $item->created, JText::_('TEMPLATE_DATE_DEFAULT')); ?>

                                </span>

                                <span class="item-comments">

                                    <?php if(!empty($item->event->K2CommentsCounter)): ?>
                                        <!-- K2 Plugins: K2CommentsCounter -->
                                        <?php echo $item->event->K2CommentsCounter; ?>
                                    <?php else: ?>
                                        <?php if($item->numOfComments>0): ?>
                                            <a class="moduleItemComments" href="<?php echo $item_first->link.'#itemCommentsAnchor'; ?>">
                                                <i class="fa fa-comments-o"></i> <?php echo $item->numOfComments; ?> <?php if($item->numOfComments>1) echo JText::_('K2_COMMENTS'); else echo JText::_('K2_COMMENT'); ?>
                                            </a>
                                        <?php else: ?>
                                            <a class="moduleItemComments" href="<?php echo $item_first->link.'#itemCommentsAnchor'; ?>">
                                                <i class="fa fa-comments-o"></i> <?php echo JText::_('TEMPLATE_THE_FIRST_TO_COMMENT'); ?>
                                            </a>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </span>
                            </div>

joolma error Notice: Undefined property

1 Answer 1

0

This is due to high error reporting level and bad coding. Though it will work.

SOLUTION:

Fix these errors. Since these files are override files, you can easily fix without touching extensions core files.

This answer will help you.

ALTERNATIVE SOLUTION:

Go to System > Global Configuration, then tab Server. Under Server Settings there is setting Error Reporting. Set it to None or Simple and your error notices will be gone.

5
  • Thank you bro Rene the ALTERNATIVE SOLUTION* fixed my problem but I don't know if it is good to hide errors, I try to fix these errors using your first **solution but I found it hard there is 4 .php files on the same folder with this error any time I try to fix a line I got another error the line is always something about comments counter '<?php if($item->numOfComments>0): ?>'
    – AbdoOud
    Apr 2, 2015 at 17:41
  • It's not good idea to hide these errors if you are developing. You should fix those. Somehow these variables are not defined. Try to find out why there are no such variables. I think that '$item' should always be defined. Maybe you are using wrong name for variable.
    – Rene Korss
    Apr 2, 2015 at 17:46
  • I try to do so but I couldn't find the problem, and everything on the template working fine on my localhost only one strange problem with my editor on the front end, any text I hover the mouse on it just disappear since I want users to submit articles on my website. if you have any Idea... Or I will ask about it in a new post.
    – AbdoOud
    Apr 2, 2015 at 18:00
  • Post new question for this. Add more details. Then I could understand better.
    – Rene Korss
    Apr 2, 2015 at 18:14
  • Hello Rene I just post a new question for my problem, and I add a gif picture so you can understand the problem.
    – AbdoOud
    Apr 2, 2015 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.