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"
The template should show an horizontal menu like this
but instead it shows one like this
S.O: Windows 10
Database: Mysql 5.7.17
PHP Version 7.1.2
Apache 2.4
The html code generated in J4 A3 looks like this
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 . '>';
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)
$GLOBALS['artx_settings']
...do I detect an Artisteer template?
C-Lodder
Yes you are correct.
The template waas creaetd with Artisteer
C-Lodder
Yes you are correct.
The template waas creaetd with Artisteer
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.
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
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 modChrome
s compared with Joomla 3 behavior.
Sorry again! I don't know why.
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: attribsThe 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
.
--
ReLater
Thanks for your help .
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
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.
Thanks
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-04 08:43:17 |
Closed_By | ⇒ | joomla-cms-bot |
Closed_By | joomla-cms-bot | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/23651
closed as Issue seems solved; please reopen if its not.
This ptoblem is not solved
Status | Closed | ⇒ | New |
Closed_Date | 2019-03-04 08:43:17 | ⇒ | |
Closed_By | franz-wohlkoenig | ⇒ |
Status | New | ⇒ | Discussion |
Closed_Date | 0000-00-00 00:00:00 | ⇒ |
Set to "open" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/23651
Title |
|
Category | ⇒ | Templates (site) |
Labels |
Added:
J4 Issue
|
Is this the responsibility of the user/Artisteer template to adapt to Joomla 4 since it is not stable yet? Thus close this?
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.
closed as stated above.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-08 03:42:42 |
Closed_By | ⇒ | franz-wohlkoenig |
see here please: #23505
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23651.