← Back to team overview

mahara-contributors team mailing list archive

[Bug 578217] Re: Admin->Manage Users: autoescape-related strange behaviour

 

Hi Ruslan, you're right, unfortunately master is going through an
unstable patch right now while we sort out the autoescape stuff.  I'll
fix these as you find them, but Francois & I are going through all the
templates one by one at the moment and we'll push a big fix at the end
which should remove all the {auto_escape off}{/auto_escape}.

-- 
Admin->Manage Users: autoescape-related strange behaviour
https://bugs.launchpad.net/bugs/578217
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.

Status in Mahara ePortfolio: New

Bug description:
I have discovered a problem with mahara/admin/users/search.php page. I believe it is related to recent dwoo autoescape changes (2c9d2095e) as when I disable it globally, the problem disappears.

So the nature of the problem is the following:
If I delete dwoo cache directory, I get the error when I try to open mahara/admin/users/search.php:

 ( ! ) Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '$' in /var/maharadata/dwoo/compile/default/5f5ba56797729dab4e66ce2f38c47a33.d16.php on line 5
Call Stack
#	Time	Memory	Function	Location
1	0.0002	135176	{main}( )	../search.php:0
2	0.0577	13897560	build_admin_user_search_results( )	../search.php:61
3	0.0626	14358528	Dwoo_Mahara->fetch( )	../searchlib.php:319
4	0.0626	14358600	Dwoo->get( )	../Dwoo_Mahara.php:119
5	0.0630	14443064	include( '/var/maharadata/dwoo/compile/default/var/www/mahara/theme/raw/templates/searchresulttable.tpl.d16.php' )	../Dwoo.php:363
6	0.0648	14685592	Dwoo_Plugin_eval( )	../searchresulttable.tpl.d16.php:95
7	0.0648	14685592	Dwoo->get( )	../eval.php:34
8	0.0648	14685592	Dwoo->get( )	../Dwoo.php:311

Having looked into the code, I found that this is caused by line 306, lib/searchlib.php ('template' => '{if empty($r.institutions)}{$institutions.mahara->displayname}{else}…), in particular by this snippet: “$institutions.mahara->displayname”.

I have changed it the way “$institutions[mahara]->displayname” which solved the problem – page was displayed correctly, but if I flush dwoo cache again, I get the same error. Then I changed it back to original (“$institutions.mahara->displayname”), again, the script started working as it should, but flushing dwoo cache cases the same problem again.

I am pretty sure that anyone who will perform a fresh install of Mahara from master will face this problem. Unfortunately I do not have time at the moment to look deeper into the problem. Though it might be something trivial for Richard who did all these autoescape changes recently.

This is applicable to master.







References