On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Is there anything useful in your error log file (core/cache/logs/error.log)?

    This question has been answered by Ysanmiguel. See the first response.

      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
    • Bob thanks for your time.

      I clear the error log, activate the snippet, clear the cache and run the page. I get the 500 error and the error log display this:

      [2019-01-04 10:41:04] (ERROR in modTemplateVar::renderOutput @ /var/www/sites/site.com/www/core/model/modx/modtemplatevar.class.php : 288) Old modTemplateVar getRender outputmethod is deprecated since version 2.2.0. 
      [2019-01-04 10:41:05] (ERROR @ /var/www/sites/site.com/www/core/cache/includes/elements/modplugin/51.include.cache.php : 101) PHP warning: Cannot modify header information - headers already sent by (output started at /var/www/sites/site.com/www/core/model/modx/modresponse.class.php:170)
      [2019-01-04 10:41:16] (ERROR in modTemplateVar::renderOutput @ /var/www/sites/site.com/www/core/model/modx/modtemplatevar.class.php : 288) Old modTemplateVar getRender outputmethod is deprecated since version 2.2.0. 


      Any ideas?
      thanks Bob!
        --
        ysanmiguel.com
      • I think the second error message is the clue. What is the plugin with the ID 51? And what is the code section of that cache file (core/cache/includes/elements/modplugin/51.include.cache.php) around line 101.?
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
        • discuss.answer
          Well it's working now, looks like the google link stop working because now they charge for the feeder link, so the solution was pay for it and get a new API key sad
          Thanks Bob for your time and I'll check the other error in the ID 51.

          here the code if someone need it:

          <?php
          $reviews  = file_get_contents('https://maps.googleapis.com/maps/api/place/details/json?reference=***FEED CODE HERE***&sensor=true&key=***API KEY HERE***');
          $reviews  = json_decode($reviews);
          $response = '';
          $class    = '';
          $i        = 0;
          $j        = 1;
          
          if(!is_object($reviews) || empty($reviews->result)) {
          	return $modx->parseChunk('reviews-google-pod');
          }
          
          $response .= '<div class="slides">';
          
          // Generate the reviews
          foreach($reviews->result->reviews as $review) {
          	if(!$i) {
          		$class = ' active';
          	}
          
          	$response .= $modx->parseChunk('review-item', array(
          		'reviewText' => $review->text,
          		'reviewer'   => $review->author_name,
          		'date'       => date('jS F Y',$review->time),
          		'datetime'   => date('Y-m-d',$review->time),
          		'rating'     => $review->rating,
          		'class'      => $class,
          	));
          
          	$i++;
          	unset($class);
          }
          
          $response .= '</div>';
          $response .= '<ul class="controls">';
          
          // Generate the slider controls
          foreach($reviews->result->reviews as $review) {
          	if($j == 1) {
          		$class = ' class="active"';
          	}
          
          	$response .= '
          		<li'.$class.'>
          			<a href="#">'.$j.'</a>
          		</li>
          	';
          
          	$j++;
          	unset($class);
          }
          
          $response .= '</ul>';
          
          return $response;
            --
            ysanmiguel.com