? J3 Issue ?
avatar jooservices
jooservices
11 Jul 2018

Steps to reproduce the issue

Check: libraries/src/Layout/LayoutHelper.php
Line 57
* @param object $displayData Object which properties are used inside the layout file to build displayed output

Expected result

$displayData should be declared as array

Actual result

But it's declared as object

System information (as much as possible)

Additional comments

avatar jooservices jooservices - open - 11 Jul 2018
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jul 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Jul 2018
avatar jooservices jooservices - change - 11 Jul 2018
The description was changed
avatar jooservices jooservices - edited - 11 Jul 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Jul 2018
Category Code style Libraries
avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Jul 2018
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Jul 2018

@Quy can you please have a Look?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21071.

avatar schnuti
schnuti - comment - 20 Jul 2018

Most, if not all, core JLayouts use an object for $displayData. In the beginning of JLayout the documentation said "use an array". If I understand it correct, the object data is sent by reference, array data not.
e.g.

LayoutHelper::render('joomla.edit.title_alias', $this)

$form  = $displayData->getForm();
avatar brianteeman brianteeman - change - 2 Aug 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 2 Aug 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Aug 2018

@jooservices is this Issue solved by Comment of @schnuti?

avatar jooservices
jooservices - comment - 17 Aug 2018

Hi there
Sorry but i don't think so. Even in Joomla! we still have this "issue"

administrator/components/com_users/views/levels/tmpl/default.php
line 40
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false))); ?>

So, as you can see param 2 is array.
But inspect
JLayoutHelper::render
we have function
public static function render($layoutFile, $displayData = null, $basePath = '', $options = null)

and docblock is

  • @param object $displayData Object which properties are used inside the layout file to build displayed output

So, I think issue still there.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Aug 2018

@jooservices Thanks for Comment.

avatar schnuti
schnuti - comment - 17 Aug 2018

My comment was on the title of the issue. Object is valid as also array or string or null.
If someone wants to exchange Object with Data in a PR it would be neutral and correct.

avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Aug 2018
Status Information Required Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Apr 2019
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 7 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 9 Apr 2019
Category Code style Libraries Libraries
avatar N6REJ
N6REJ - comment - 2 Jun 2019

Gotta love subtleties

avatar Quy Quy - change - 2 Jun 2019
Status Discussion Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-02 17:08:44
Closed_By Quy
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jun 2019
Status Fixed in Code Base Closed
Closed_By Quy joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 2 Jun 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 2 Jun 2019

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/21071

avatar Quy
Quy - comment - 2 Jun 2019

Fixed in PR #21837


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21071.

Add a Comment

Login with GitHub to post a comment