Issue 851 - Issues: Invalid argument supplied for foreach() (indefero)

2 views
Skip to first unread message

no-r...@ceondo.com

unread,
Oct 25, 2013, 8:21:41 AM10/25/13
to indefero...@googlegroups.com
Hello,

A new issue has been created and assigned
to you:

851 - Issues: Invalid argument supplied for foreach()
Project: Indefero
Status: New
Reported by: Mathias Bavay
Labels:
Type:Defect
Priority:Medium

Description:

Hi!

I've had several problems with issues that seem to be properly listed in the database, but when accessing thme through Indefero, it makes an error:

PlufErrorHandlerException making GET request to /p/meteoio/issues/19/
2 : Invalid argument supplied for foreach()

So far, my only solution has been to manually delete the offending issues in the database (which is not really a proper fix!).

Please find here below the full backtrace.

Mathias

PHP: /tmp/Pluf_Template-6f685664dc01a83e5e04266949d03e87.phps, line 197
URI: GET /p/meteoio/issues/19/

** Stacktrace **

* PlufErrorHandler
[/tmp/Pluf_Template-6f685664dc01a83e5e04266949d03e87.phps, line 197] *
* Src *
192: <strong><?php if ($t->_vars->w == 'su'): echo(__('Summary:')); endif; if ($t->_vars->w == 'st'): echo(__('Status:')); endif; if ($t->_vars->w == 'ow'): echo(__('Owner:')); endif; if ($t->_vars->w == 'lb'): echo(__('Labels:')); endif; if ($t->_vars->w == 'rel'): echo(__('Relations:')); endif; ?></strong>
193: <?php if ($t->_vars->w == 'lb' or $t->_vars->w == 'rel'): ?>
194:
195: <?php foreach ($t->_vars->v as $t->_vars->t => $t->_vars->ls): ?>
196:
>> 197: <?php foreach ($t->_vars->ls as $t->_vars->l): ?>
198:
199: <?php if ($t->_vars->t == 'rem'): ?><s><?php endif; Pluf_Template_safeEcho($t->_vars->l); if ($t->_vars->t == 'rem'): ?></s><?php endif; ?>
200:
201: <?php endforeach; ?>
202:

* Pluf_Template_6f685664dc01a83e5e04266949d03e87::render
[No File, line 0] *
No src available.
* call_user_func
[/home/pluf/src/Pluf/Template.php, line 97] *
* Src *
92: }
93: $this->context = $c;
94: ob_start();
95: $t = $c;
96: try {
>> 97: call_user_func(array($this->class, 'render'), $t);
98: //include $this->compiled_template;
99: } catch (Exception $e) {
100: ob_clean();
101: throw $e;
102: }

* Pluf_Template->render
[/home/pluf/src/Pluf/Shortcuts.php, line 92] *
* Src *
87: if (is_null($request)) {
88: $context = new Pluf_Template_Context($params);
89: } else {
90: $context = new Pluf_Template_Context_Request($request, $params);
91: }
>> 92: return new Pluf_HTTP_Response($tmpl->render($context));
93: }
94:
95:
96: /**
97: * Get a given form from a model.

* Pluf_Shortcuts_RenderToResponse
[/home/indefero/src/IDF/Views/Issue.php, line 673] *
* Src *
668: 'previous_issue_id' => $previous_issue_id,
669: 'next_issue_id' => $next_issue_id,
670: 'related_issues' => $related_issues,
671: ),
672: $arrays),
>> 673: $request);
674: }
675:
676:
677: /**
678: * Download a given attachment.

* IDF_Views_Issue->view
[/home/pluf/src/Pluf/Dispatcher.php, line 202] *
* Src *
197: return $res;
198: }
199: }
200: }
201: if (!isset($ctl['params'])) {
>> 202: return $m->$ctl['method']($req, $match);
203: } else {
204: return $m->$ctl['method']($req, $match, $ctl['params']);
205: }
206: }
207:

* Pluf_Dispatcher::send
[/home/pluf/src/Pluf/Dispatcher.php, line 129] *
* Src *
124: $i = 0;
125: while ($i<$n) {
126: $ctl = $views[$i];
127: if (preg_match($ctl['regex'], $to_match, $match)) {
128: if (!isset($ctl['sub'])) {
>> 129: return self::send($req, $ctl, $match);
130: } else {
131: // Go in the subtree
132: $views = $ctl['sub'];
133: $i = 0;
134: $n = count($views);

* Pluf_Dispatcher::match
[/home/pluf/src/Pluf/Dispatcher.php, line 56] *
* Src *
51: break;
52: }
53: }
54: }
55: if ($skip === false) {
>> 56: $response = self::match($req);
57: if (!empty($req->response_vary_on)) {
58: $response->headers['Vary'] = $req->response_vary_on;
59: }
60: $middleware = array_reverse($middleware);
61: foreach ($middleware as $mw) {

* Pluf_Dispatcher::dispatch
[/home/indefero/www/index.php, line 28] *
* Src *
23:
24: require dirname(__FILE__).'/../src/IDF/conf/path.php';
25: require 'Pluf.php';
26: Pluf::start(dirname(__FILE__).'/../src/IDF/conf/idf.php');
27: Pluf_Dispatcher::loadControllers(Pluf::f('idf_views'));
>> 28: Pluf_Dispatcher::dispatch(Pluf_HTTP_URL::getAction());
29:
30:
31:





** Request **

* Request (raw) *

HEADERS
Host: models.slf.ch
Connection: Keep-alive
Accept: */*
From: googlebot(at)googlebot.com
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Accept-Encoding: gzip,deflate


* Request (parsed) *

$_GET
No data

$_POST
No data

$_COOKIE
No data

$_SERVER
Variable: REDIRECT_HTTPS
Value: on
Variable: REDIRECT_SSL_TLS_SNI
Value: models.slf.ch
Variable: REDIRECT_STATUS
Value: 200
Variable: HTTPS
Value: on
Variable: SSL_TLS_SNI
Value: models.slf.ch
Variable: HTTP_HOST
Value: models.slf.ch
Variable: HTTP_CONNECTION
Value: Keep-alive
Variable: HTTP_ACCEPT
Value: */*
Variable: HTTP_FROM
Value: googlebot(at)googlebot.com
Variable: HTTP_USER_AGENT
Value: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Variable: HTTP_ACCEPT_ENCODING
Value: gzip,deflate
Variable: SERVER_SIGNATURE
Value: <address>Apache/2.2.22 (Ubuntu) Server at models.slf.ch Port 443</address>

X-Powered-By: PHP/5.3.10-1ubuntu3.8

--
Issue: http://projects.ceondo.com/p/indefero/issues/851/


Reply all
Reply to author
Forward
0 new messages