which is best to correct parameter 2 & 3 modChrome error

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
scifivision
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 142
Joined: Mon Jun 01, 2009 5:24 am

which is best to correct parameter 2 & 3 modChrome error

Post by scifivision » Tue Jul 16, 2019 5:26 am

I updated Joomla to 3.9.10, and I found an error on the front page when I had the error reporting on. I realized this was also happening on my 3.8.10 install, but I didn't have the debug on. On the earlier version it shows on system default debugging, whereas on 3.9 I have to up that to simple. The site is running on PHP 7.2.19 and Apache.

Warning: Parameter 2 to modChrome_artnostyle() expected to be a reference, value given in /home/user/public_html/mysite/templates/mytemplate/html/modules.php on line 36

Warning: Parameter 3 to modChrome_artnostyle() expected to be a reference, value given in /home/user/public_html/mysite/templates/mytemplate/html/modules.php on line 36

It seems this is a problem that was created using templates made with Artisteer, which basically has no support anymore. I need to at the moment, however, keep using this template until I can make a new one I'm happy with.

I found two solutions. One was to take the "&"s out of the code in modules.php here:

Code: Select all

function modChrome_artnostyle($module, &$params, &$attribs)

function modChrome_artblock($module, &$params, &$attribs)

function modChrome_artvmenu($module, &$params, &$attribs)

function modChrome_artarticle($module, &$params, &$attribs) 
That works. At first I figured it was just something that was depreciated in the php and it was an okay fix. But then I read that that was just hiding it, and that instead, I should go to the active modules under advanced settings and change "Inherited" to the type of module under the template that module is working with. The reason why I really do not want to do this second option, is I have a lot of modules; some I don't remember particularly what they are or do or which type I want. I also would like that later if I update the template that I don't have to reset each one of them and they can stay inherited.

Is the first answer of changing the code a viable fix or is it bad to do that? Is there another way?

User avatar
paulala
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Sat Oct 30, 2010 12:32 pm
Location: Scotland
Contact:

Re: which is best to correct parameter 2 & 3 modChrome error

Post by paulala » Tue Jul 16, 2019 8:13 am

I take it you've seen this: http://www.artisteer.com/?post_id=25267 ... orum_id=20

What you are doing there by removing the ampersand is changing the arguments of the functions from references to straightforward variables. The bottom line is this is going to make the behaviour of the template diverge from the intended but it won't under every use case.

So in the light of that the only advice that can reasonably be given is if it works for you then its fine, (until it stops working for you)

Its almost certainly not a viable fix but its probably good enough. Without seeing and spending time examining the whole template its impossible to say anything else.
Warm Regards,
Paula Livingstone, Skydiving Instructor and Network Security Consultant
https://paulalivingstone.com
http://rustyice.co.uk

scifivision
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 142
Joined: Mon Jun 01, 2009 5:24 am

Re: which is best to correct parameter 2 & 3 modChrome error

Post by scifivision » Tue Jul 16, 2019 9:21 am

Thanks. I just was afraid it might cause a problem down the road after another update. But it’s easier to change the code again then go back through all of my modules.


Post Reply

Return to “Templates for Joomla! 3.x”