J4 Issue ?
avatar fgonc124
fgonc124
23 Jan 2019

Steps to reproduce the issue

I have a template that works in Joomla 3.9.1. and in Joomla 4 Alfa 1 to Alfa 3, but stoped work in latest Joomla4 Alfa versions, Alfa 5 e Alfa 6 .

Install "lcp" (my template) template, Create some menu items on menu "Mainmenu". Module "mainmenu" on position "user3"

Expected result

The template should show an horizontal menu like this

screen shot 2019-01-23 at 17 54 03

Actual result

but instead it shows one like this
screen shot 2019-01-23 at 17 55 43

System information (as much as possible)

S.O: Windows 10
Database: Mysql 5.7.17
PHP Version 7.1.2
Apache 2.4

Additional comments

The html code generated in J4 A3 looks like this
screen shot 2019-01-23 at 18 04 03

and in J4 A6 looks like this
screen shot 2019-01-23 at 18 05 47

J4 A6 generates a class with name "menu" instead of "lcp-hmenu"

The code in html\mod_menu\default.php generates the correct html if $attribs is set, , as you can see below.

In J4 A3 this variable is set but in J4 A6 is not.

Module "mainmenu" is in position "user3" on both versions.

WHy is this variable not set in J4 A6? How can I debug this error? Where should I look to find the bug or is a problem of J4 A5/A6?

Is $attribs variable defined by Joomla?

<?php
defined('_JEXEC') or die;
require_once dirname(FILE) . str_replace('/', DIRECTORY_SEPARATOR, '/../../functions.php');

// Note. It is important to remove spaces between elements.

$tag = ($params->get('tag_id') != NULL) ? ' id="' . $params->get('tag_id') . '"' : '';

if (isset($attribs['name']) && $attribs['name'] == 'user3') {

$menutype = 'horizontal';

$start = $params->get('startLevel');

// render subitems or not.

$subitems = $GLOBALS['artx_settings']['menu']['show_submenus'] && 1 == $params->get('showAllChildren');

// true - skip current node, false - render current node.

$skip = false;

echo '<ul class="lcp-hmenu"' . $tag . '>';

avatar fgonc124 fgonc124 - open - 23 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Jan 2019
avatar ChristineWk
ChristineWk - comment - 23 Jan 2019

see here please: #23505


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23651.
avatar fgonc124
fgonc124 - comment - 23 Jan 2019

ChristineWk
It was me that openned that issue but I don't understand why it was closed.

I think this an issue of J4 Alpha 6 because this twmplate worked in previous versions ( until Apha 3)


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

avatar C-Lodder
C-Lodder - comment - 23 Jan 2019

$GLOBALS['artx_settings']...do I detect an Artisteer template?

avatar fgonc124
fgonc124 - comment - 23 Jan 2019

C-Lodder

Yes you are correct.

The template waas creaetd with Artisteer


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

avatar fgonc124
fgonc124 - comment - 23 Jan 2019

C-Lodder

Yes you are correct.

The template waas creaetd with Artisteer


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

avatar ReLater
ReLater - comment - 23 Jan 2019

It was me that openned that issue but I don't understand why it was closed.

You closed it yourself.

I think this an issue of J4 Alpha 6 because this twmplate worked in previous versions ( until Apha 3)

J4 code changes every day and partially extremely because we're talking about Alpha releases. And also J4 Alpha 6 is not the current state: See https://developer.joomla.org/nightly-builds.html

When J4 started the code was very near to Joomla 3. But the purpose of J4 is to leave "outdated" code behind and to go new ways.

I think that your expectation that a Joomla 3 template of Artisteer (far away from a Joomla standard) must work with current Joomla 4 Alpha is wrong. Only very simple Joomla 3 templates work PERHAPS with Joomla 4 and developpers have to adjust their templates and template builders before they can mark it "Joomla-4-ready".

So I would say that's not a Joomla issue.

avatar fgonc124
fgonc124 - comment - 23 Jan 2019

ReLater
I used one of builds but the result was the same.

I just don't understand why the variable $attribs is not set on J4 A6 and is set on J4 A3.
On file html\modules.php that variable is set.

I don't know how can I debug this . I don't know where to begin.

If I knew where that variable is defined I could try to debug .
Do you know if that variable is defined by Joomla or is defined on another file ?

Thanks


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

avatar ReLater
ReLater - comment - 24 Jan 2019

Ah, sorry! Now I understand.

I added a position in Casseiopaia (J4) index.php
<jdoc:include type="modules" name="position-0" style="none" testattrib="chingchang" />

Created a module in position-0 and debugged $attribs in tmpl/default.php.
Notice: Undefined variable: attribs

The same procedure with Joomla 3 and Protostar. Debug in tmpl/default.php:
Array ( [name] => position-0 [style] => none [testattrib] => chingchang )

Thus I can confirm that $attribs array is not passed over to module layouts in J4.

In modules.php::modChrome_* of Joomla 4 $attribs doesn't provide the Array like shown above but contains more or less senseless informations about the used modChrome_* itself.
E.g. Array ( [name] => main-top [style] => cardGrey ) (module style cardGrey). I have no idea why name is main-top now instead of position-0

In modules.php::modChrome_* of Joomla 3 $attribs is the same Array like shown above.
Array ( [name] => position-0 [style] => none [testattrib] => chingchang )

Thus I can confirm that $attribs array is different in modChromes compared with Joomla 3 behavior.

Sorry again! I don't know why.

avatar mbabker
mbabker - comment - 24 Jan 2019

You’re probably dealing with something that worked more by chance than
being an actual API feature. Because of how modules are included, a lot of
variables internal to the render method leak into module files. If it’s
not the $module or $params variables I would not suggest relying on it (a
full list is documented in some module in one of the joomla.org repos).

On Wed, Jan 23, 2019 at 7:06 PM ReLater notifications@github.com wrote:

Ah, sorry!

Now I understand. I added in Casseiopaia (J4) index.php
<jdoc:include type="modules" name="position-0" style="none"
testattrib="chingchang" />

Created a module in position-0 and debugged $attribs in tmpl/default.php.
Notice: Undefined variable: attribs

The same procedure with Joomla 3. Debug in tmpl/default.php:
Array ( [name] => position-0 [style] => none [testattrib] => chingchang )

Thus I can confirm that $attribs array is not passed over to module
layouts.

In modules.php::modChrome_* of Joomla 4 $attribs doesn't provide the
Array like shown above but changes it to more or less senseless
informations about the used modChrome_* itself.

In modules.php::modChrome_* of Joomla 3 $attribs is the same Array like
shown above.

Thus I can confirm that $attribs array is different in modChromes
compared with Joomla 3 behavior.

Sorry again! I don't know why.


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

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar fgonc124
fgonc124 - comment - 24 Jan 2019

ReLater

Thanks for your help .

avatar fgonc124
fgonc124 - comment - 24 Jan 2019

mbabker

Can you tell me where that full list is documented ?.

Something changed from version Alpha 3 to Alpha 5/6. On Alpha 3 that variable was set .

Thanks

avatar mbabker
mbabker - comment - 24 Jan 2019

Here is a list of all variables that in 3.x are leaking forward to modules from the render method. After being refactored to support a dispatcher and OOP design, here are the variables that are being pushed into modules. Note that attribs is not included as this was not intended to be something that modules themselves actually were aware of, but because of scoop creep was available in that context. As I said, it should not be relied upon.

avatar fgonc124
fgonc124 - comment - 24 Jan 2019

Thanks

avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-03-04 08:43:17
Closed_By joomla-cms-bot
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Closed_By joomla-cms-bot franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - close - 4 Mar 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Mar 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

closed as Issue seems solved; please reopen if its not.


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

avatar fgonc124
fgonc124 - comment - 4 Mar 2019

This ptoblem is not solved


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

avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2019
Status Closed New
Closed_Date 2019-03-04 08:43:17
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - reopen - 4 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Discussion
Closed_Date 0000-00-00 00:00:00
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Mar 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

thanks for Info @fgonc124 , reopened.

avatar joomla-cms-bot joomla-cms-bot - change - 28 Mar 2019
Title
Joomla 4 Alfa 6 horizontal menu not working
[4.0] Alpha 6 horizontal menu not working
avatar joomla-cms-bot joomla-cms-bot - edited - 28 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category Templates (site)
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar Quy
Quy - comment - 7 Jun 2019

Is this the responsibility of the user/Artisteer template to adapt to Joomla 4 since it is not stable yet? Thus close this?

avatar mbabker
mbabker - comment - 8 Jun 2019

Should be closed as a won't fix and/or known B/C break. Again, this is someone's module relying on functionality that happened to work due to scope creep and not purposeful API design.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Jun 2019

closed as stated above.

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Jun 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-06-08 03:42:42
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 8 Jun 2019

Add a Comment

Login with GitHub to post a comment