Issue 822 - sudden problem with "Issues Search" Options (indefero)

11 views
Skip to first unread message

no-r...@ceondo.com

unread,
Sep 27, 2012, 3:45:30 AM9/27/12
to indefero...@googlegroups.com
Hello,

A new issue has been created and assigned
to you:

822 - sudden problem with "Issues Search" Options
Project: Indefero
Status: New
Reported by: Nikolaus Schaller
Labels:
Type:Defect
Priority:Medium

Description:

when trying to search Issues (in any project), I suddenly get 500
errors from the
server, but I am sure it did work before. I can add and work with
Issues and everything
else.
I am still using Indefero 1.2 because I didn't want to touch a running
system
and the upgrade to 1.3 wasn't reported to be smooth.
Thank you!
Nikolaus
The debug e-mail is:
PlufErrorHandlerException making GET request to /p/gta04-kernel/issues/
search/?q=sgx530&s=Search
8 : Trying to get property of non-object
PHP: /private/tmp/Pluf_Template-c0390ba611dae823e263efbbd1f7f115.phps,
line 153
URI: GET /p/gta04-kernel/issues/search/?q=sgx530&s=Search
** Stacktrace **
* PlufErrorHandler
[/private/tmp/Pluf_Template-
c0390ba611dae823e263efbbd1f7f115.phps, line 153] *
* Src *
148: <p><strong>Found closed issues:</strong> <a href="%%closed_url%%">
%%closed%%</a></p><?php $_b_t_s=ob_get_contents(); ob_end_clean();
echo(Pluf_Translation::sprintf(__($_b_t_s), array('open_url' =>
Pluf_Template_safeEcho($t->_vars->open_url, false), 'open' =>
Pluf_Template_safeEcho($t->_vars->open, false), 'closed_url' =>
Pluf_Template_safeEcho($t->_vars->closed_url, false), 'closed' =>
Pluf_Template_safeEcho($t->_vars->closed, false)))); ?>
149:
150: <?php if ($t->_vars->tag !== null): ?>
151:
152: <?php ob_start(); ?><p><strong>Label:</strong>
153: <a href="%%open_url%%" class="label"><strong>%%tag.class%%:</
strong>%%tag.name%%</a></p><?php $_b_t_s=ob_get_contents();
ob_end_clean(); echo(Pluf_Translation::sprintf(__($_b_t_s),
array('open_url' => Pluf_Template_safeEcho($t->_vars->open_url,
false), 'tag.class' => Pluf_Template_safeEcho($t->_vars->tag->class,
false), 'tag.name' => Pluf_Template_safeEcho($t->_vars->tag->name,
false)))); ?>
154:
155: <?php else: ?>
156:
157:
158: <div id="tagscloud" class="smaller"><dl><?php foreach ($t->_vars-
>all_tags as $t->_vars->class => $t->_vars->labels): ?>

* Pluf_Template_c0390ba611dae823e263efbbd1f7f115::render
[No File, line 0] *
No src available.
* call_user_func
[/Library/WebServer/Sites/projects.goldelico.com/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
[/Library/WebServer/Sites/projects.goldelico.com/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
[/Library/WebServer/Sites/projects.goldelico.com/indefero/src/
IDF/Views/Issue.php, line 587] *
* Src *
582: 'closed' => $closed,
583: 'tag' => $tag,
584: 'all_tags' => $grouped_tags,
585: );
586:
587: return Pluf_Shortcuts_RenderToResponse('idf/issues/
search.html', $params, $request);
588: }
589:
590: public $view_precond =
array('IDF_Precondition::accessIssues');
591: public function view($request, $match)
592: {
* IDF_Views_Issue->doSearch
[/Library/WebServer/Sites/projects.goldelico.com/indefero/src/
IDF/Views/Issue.php, line 454] *
* Src *
449:
450: public $search_precond =
array('IDF_Precondition::accessIssues');
451: public function search($request, $match)
452: {
453: $query = !isset($request->REQUEST['q']) ? '' : $request-
>REQUEST['q'];

454: return $this->doSearch($request, $query, 'open');
455: }
456:
457: public $searchStatus_precond =
array('IDF_Precondition::accessIssues');
458: public function searchStatus($request, $match)
459: {
* IDF_Views_Issue->search
[/Library/WebServer/Sites/projects.goldelico.com/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
[/Library/WebServer/Sites/projects.goldelico.com/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
[/Library/WebServer/Sites/projects.goldelico.com/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
[/Library/WebServer/Sites/projects.goldelico.com/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:

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


no-r...@ceondo.com

unread,
Dec 13, 2012, 2:42:56 AM12/13/12
to indefero...@googlegroups.com
Hello,

The following issue has been updated:

822 - sudden problem with "Issues Search" Options
Project: Indefero
Status: New
Reported by: Nikolaus Schaller
URL: http://projects.ceondo.com/p/indefero/issues/822/
Labels:
Type:Defect
Priority:Medium

Comments (last first):

# By Thomas Keller, Dec 13, 2012:

Michael B. seems to have a similar / identical problem.

@Nikolaus: Maybe you two could work together to figure out what exactly is wrong?

# By Nikolaus Schaller, Sep 27, 2012:

no-r...@ceondo.com

unread,
Dec 13, 2012, 2:53:04 PM12/13/12
to indefero...@googlegroups.com
Hello,

The following issue has been updated:

822 - sudden problem with "Issues Search" Options
Project: Indefero
Status: New
Reported by: Nikolaus Schaller
URL: http://projects.ceondo.com/p/indefero/issues/822/
Labels:
Type:Defect
Priority:Medium

Comments (last first):

# By مصطفی برمشوری, Dec 13, 2012:

I upgrade to new version, and it works well.

# By Thomas Keller, Dec 13, 2012:

Michael B. seems to have a similar / identical problem.

@Nikolaus: Maybe you two could work together to figure out what exactly is wrong?

# By Nikolaus Schaller, Sep 27, 2012:

no-r...@ceondo.com

unread,
Apr 22, 2013, 12:29:31 PM4/22/13
to indefero...@googlegroups.com
Hello,

The following issue has been updated:

822 - sudden problem with "Issues Search" Options
Project: Indefero
Status: New
Reported by: Nikolaus Schaller
URL: http://projects.ceondo.com/p/indefero/issues/822/
Labels:
Type:Defect
Priority:Medium

Comments (last first):

# By Nikolaus Schaller, Apr 22, 2013:

Finally I did have some time to dig into the issue again (I am not a daily PHP programmer...).

Firstly I upgraded to Indefero 1.3.3 but no difference.

Then I played a full day with PHP echo, print_r, var_export to understand what is going on.

Now I think I have traced it down to a strange behaviour of ArrayObject used to store the parameters passed to a compiled PLUF template.

Here is my code to print some variables added to Pluf_Template_Context_Request::__construct:

echo "context array tag 1: "; echo var_export($params['context']['tag'], true); echo "<p>";
$this->_vars = new Pluf_Template_ContextVars($params['context']);
echo "context array tag 2: "; echo var_export($this->_vars['tag'], true); echo "<p>";
echo "context array tag 3: "; echo var_export($this->_vars->tag, true); echo "<p>";

The output is (please note that this breaks other pages except issues search):

context array tag: NULL
context array tag: NULL
context array tag: __get(tag) ''

I.e. access by array index correctly returns nil while access by property returns the empty string we have seen a while ago (see discussions on mailing list).

The __get(tag) prefix comes from this code

class Pluf_Template_ContextVars extends ArrayObject
{
function __get($prop)
{
echo "__get($prop) "; flush();
return (isset($this[$prop])) ? $this[$prop] : '';
}


This means that a 'null' value in the array that is used to construct the ArrayObject is NOT creating a property, but treated as a non-existing entry. Therefore it is not set and the __get() method returns a '' placeholder.

A great solution could be to replace all 'null' objects by some private null object and decode that special case in __get($prop).

But I have not experienced significant side effects returning 'null' in __get(tag).

So IMHO it turns out to be a bug or undocumented feature of Pluf or PHP but I have no idea why nobody else had ever seen this issue.

Maybe expected behaviour should become part of the Unit Tests for Pluf_Template_Context_Request.

# By مصطفی برمشوری, Dec 13, 2012:

I upgrade to new version, and it works well.

# By Thomas Keller, Dec 13, 2012:

Michael B. seems to have a similar / identical problem.

@Nikolaus: Maybe you two could work together to figure out what exactly is wrong?

# By Nikolaus Schaller, Sep 27, 2012:

Reply all
Reply to author
Forward
0 new messages