Update SiteApplication.php to initialize properly the template object caused by #30192#30360
Update SiteApplication.php to initialize properly the template object caused by #30192#30360joeforjoomla wants to merge 12 commits intojoomla:4.0-devfrom
Conversation
|
@dgrammatiko you are here |
|
@joeforjoomla sure something I overlooked, but I guess hardcoding the params to null and 0 will only work for the legacy mode. The function should be like: public function setTemplate($template, $styleParams = null, $inheritable = 0, $parent = '')
{...}So it can work for all cases |
|
Yes @dgrammatiko actually the setTemplate should have new parameters to allow setting both new properties. That would be ideal. |
|
@joeforjoomla i've updated this PR accordingly |
Both inheritable and parent are params from the template_styles table, so it makes sense to keep them consistent
|
@joeforjoomla @wilsonge I was wrong here, we don't need to change the signature of the function, check joeforjoomla#1 |
Co-authored-by: Quy <quy@fluxbb.org>
Co-authored-by: Quy <quy@fluxbb.org>
@joeforjoomla From a system template? Or from a system plugin? |
|
@richard67 ops sorry.. obviously system plugin |
|
No problem, can happen. |
|
Unit test failure is not related to this PR. |
|
I have tested this item ✅ successfully on 578166f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
@joeforjoomla It doesn't make sense to test your own PR since the rules say that when you propose a PR, you have to test it yourself anyway. |
|
I have tested this item ✅ successfully on 578166f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
I have tested this item ✅ successfully on 578166f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
RTC |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
Back to pending as there are unaddressed comments. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
@joeforjoomla Is @JoeJoomlaCoder also an account from you? |
|
I have tested this item ✅ successfully on 578166f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
Called setTemplate() method in a System Plugin -> PHP Notice This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
|
This PR still has open review comments and also fail the PHP code style test by drone. For fixing the latter I'll suggest a correction in a minute. But as long as the review comments are not addressed I can't really set RTC. |
|
Sorry, my fault. The issues Joomla Site update not correctly after posting "Test this". So I post it again and it was double. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30360. |
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
|
@richard67 any update on this? Can we get it merged quickly? What is still missing? |
|
@joeforjoomla please address this comment #30360 (comment) |
|
@dgrammatiko i don't think that #30360 is a good idea, having a string or an object assigned to the property $this->template->template is not an option, indeed extension have always assumed that this is a string matching the template name. However #30360 is quite unrelated to this PR. |
I guess that was an example code and they meant |
|
Ok but honestly i don't understand what i should do here in relation to this PR. Eventually that can be merged as a separate PR. |
|
This is still an issue. What to do to merge a fix? |
|
Creating a fake account in order to mark that you had tested something doesnt really inspire people to accept that test result. If you want people to test something that is not trivial then you need to give test instructions that are easy to follow |
|
@brianteeman this is an open bug, nobody is interested to create fake accounts but just fix the Joomla code |
small change to let ci running
|
Closing in favour of #32710 . @joeforjoomla Sorry, I hope you are not too angry or disappointed. Feel free to re-open here if you think it is a mistake that I closed it. |
Related to #30192
Summary of Changes
Add the new properties 'parent' and 'inheritable' to the object initialized in the 'setTemplate' method so that there are no 'Notice' if a plugin calls the 'setTemplate' method to override the template used
Testing Instructions
Call the 'setTemplate' method from a system plugin
Actual result BEFORE applying this Pull Request
Notice for undefined property 'parent'

Expected result AFTER applying this Pull Request
No PHP notice
Documentation Changes Required
No