?
avatar chrisdavenport
chrisdavenport
4 Dec 2016

Steps to reproduce the issue

Go to Global Configuration. Click on Permissions tab.

Expected result

Actual result

Text from the Text Filters tab is also shown on the Permissions tab.
See screenshot.

System information (as much as possible)

Current nightly build (4 Dec 2016). Default template.

Additional comments

screenshot from 2016-12-04 14-20-02

avatar chrisdavenport chrisdavenport - open - 4 Dec 2016
avatar joomla-cms-bot joomla-cms-bot - change - 4 Dec 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Dec 2016
avatar zero-24
zero-24 - comment - 4 Dec 2016

confirmed can be fixed by setting $this->description = ''; (or similiar) here: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_config/view/application/tmpl/default_permissions.php but it does not look like the correct solution.

i guess it is because of this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_config/view/application/tmpl/default_filters.php#L14 is called before: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_config/view/application/tmpl/default.php#L106-L120

But I'm not sure if just overrideing the value is correct. I think it should bever be reused?

avatar zero-24 zero-24 - change - 5 Dec 2016
Status New Confirmed
Labels Added: ?
avatar zero-24 zero-24 - labeled - 5 Dec 2016
avatar zero-24 zero-24 - change - 5 Dec 2016
Category UI/UX
avatar andrepereiradasilva
andrepereiradasilva - comment - 8 Dec 2016

could this be related to this simple layout change?? #12851

if so there is really some thing messy here ...

avatar ggppdk
ggppdk - comment - 8 Dec 2016

$this
is shared among templates (e.g. it contains $this->form),
-- and it ($this) is passed as "$displaydata" to the templates

any variable you set in a previous template is accessible by subsequently loaded templates,

Meaning:
-- the template files should never assume that a variable will not be set if they do not set it !

some previously loaded template may have already set this particular variable

avatar brianteeman
brianteeman - comment - 8 Dec 2016

This might explain why the text on the bottom of the permissions tan is
also wrong. @jeckodevelopment reported that a long time ago

On 8 Dec 2016 1:27 p.m., "Georgios Papadakis" notifications@github.com
wrote:

$this
is shared among templates (e.g. it contains $this->form),
-- and it ($this) is passed as "$displaydata" to the templates

any variable you set in a previous template is accessible by subsequently
loaded templates,

Meaning:
-- the template files should never assume that a variable will not be
set if the do not set it
!

some previously loaded template may have already set this particular
variable


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13083 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8W6NVpmrOD0P3Cxm-qDo1lBGyPQOks5rGAWogaJpZM4LDmMc
.

avatar ggppdk
ggppdk - comment - 8 Dec 2016

So the template files: like
com_config/view/application/tmpl/default_filters.php
com_config/view/application/tmpl/default_permissions.php

are passing "$this" as "$displayData" to the layout file:
layouts/joomla/content/options_default.php

and this was done deliberately, right ?
-- to avoid creating a new "$displayData" every time, and every time, reassigning variables like ->form ?
-- and also to be able to pass data from 1 template file to the next ?

So this behaviour, is not something to be changed (since it may create more bugs, and also similar code is used everywhere ?)

Only thing is that templates should not assume that a variable is not set into $this, if they do not set it
e.g. in this case as zero-24 said, this fixes it:
$this->description = '';

I argue it is probably proper thing to do now, instead of something that else that may create more problems

avatar mbabker
mbabker - comment - 8 Dec 2016

A complete crap decision was made to just pass the view object into the layout files all throughout the admin (both MVC structures). It's caused more issues than it's worth and honestly is worth the B/C break in 4.0 to clean up. #11054 is another case where this decision has bitten us in the rear end.

avatar ggppdk
ggppdk - comment - 8 Dec 2016

@mbabker

It's caused more issues than it's worth and honestly is worth the B/C break in 4.0 to clean up.

yes, it is as you say, but as you also say any such change should be better be in 4.0

It is not "urgent" / important to change this in J3.x

i feel it will be too much work, and too much testings time to change this in J3.x (everywhere),
because creating a new object to pass to the layouts and then forgeting to set a variable,
and we have a new bug

avatar ggppdk
ggppdk - comment - 8 Dec 2016

i forgot

it is also a B/C break (as mbabker said)

now people maybe passing data from 1 layout to the next layout rendered
... by setting variables into the view object
so such a change would really be a B/C break

avatar infograf768
infograf768 - comment - 9 Dec 2016

This might explain why the text on the bottom of the permissions tan is also wrong. @jeckodevelopment reported that a long time ago

That one can be solved I guess in /libraries/joomla/form/fields/rules.php and does not look related to the issue here.

if you var_dump($section) while in global config permissions, you will get '' and not null
Therefore we could simply change the code there to

if ($section === 'component' || $section === null || $section = '')
		{
			$html[] = JText::_('JLIB_RULES_SETTING_NOTES');
		}
		else
		{
			$html[] = JText::_('JLIB_RULES_SETTING_NOTES_ITEM');
		}

as I don't know if $section can be null. If it can't, the patch is even more simple.

avatar infograf768
infograf768 - comment - 9 Dec 2016

Made a PR for that one
#13143

I did not add $this->description = ''; in the global config permissions view, but I tested it and it does work indeed.

avatar infograf768
infograf768 - comment - 12 Dec 2016

@zero-24
Can you do the PR for $this->description = ''; in the global config permissions view to, at least correct that one?

avatar zero-24 zero-24 - change - 14 Dec 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-12-14 09:28:16
Closed_By zero-24
avatar zero-24 zero-24 - close - 14 Dec 2016
avatar zero-24
zero-24 - comment - 14 Dec 2016

see: #13193

avatar zero-24 zero-24 - change - 14 Dec 2016
Labels Removed: ?
avatar zero-24 zero-24 - unlabeled - 14 Dec 2016

Add a Comment

Login with GitHub to post a comment