-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] fix for XTD plugins broken in frontend #23539
Conversation
I haven't had time to read and understand current MVC implementation but I think MVCFactory should not contains magic code like that. Maybe a better solution for this problem would be override createView and createModel method directly in DisplayController of com_content frontend, something like below code: protected function createModel($name, $prefix = '', $config = array())
{
if (!$prefix && $this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal')
{
$prefix = 'Administrator';
}
return parent::createModel($name, $prefix, $config);
}
protected function createView($name, $prefix = '', $type = '', $config = array())
{
if (!$prefix && $this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal')
{
$prefix = 'Administrator';
}
return parent::createView($name, $prefix, $type, $config);
} The same logic would be applied for view = article and layout = pagebreak |
@joomdonation Thank you for your comment. I looked at it again. I am far away from properly understanding the But: This special case must be specified in the child class. If we agree that in this case the variable I think this is what @mbabker means here: #23530 (comment) with
I see no reason why |
There must be a reason for that check. I am unsure but from my quick look, with your change might break the case when we try to create a frontend model (in this case, we would pass 'Site' as the value for $prefix parameter) Also, as I mentioned, we are having too much magic code to determine the $prefix base on base_path config value. That's why I think override createModel and createView method when it's needed would be better. For this, we need someone with better experience to make decision. |
@laoneo can you take a look at this? |
It seems that the prefix must always be set in |
Close because of other PR #25367 |
Thanks for this PR @astridx |
Pull Request for Issue # #23510 . (Second try :))
Summary of Changes
I deleted the
!$prefix
condition from two if statements in thelibraries/src/MVC/Factory/MVCFactory.php
class. I was looking really carefully. But I can not find a place where$prefix = 'site'
is correct ifstrpos($config['base_path'], '/administrator/')
istrue
= if$config['base_path']
is set and contains the word'/administrator/'.
The condition
!$prefix
prevents that$prefix = 'Administrator';
can be set.$prefix
is set in the linejoomla-cms/libraries/src/MVC/Controller/BaseController.php
Line 619 in a93627e
to
$prefix = 'Site;.
With this patch, no error will appear any more.
Testing Instructions / Expected result / Actual result
See #23510
Documentation Changes Required
No
What I noticed
What still confuses me is the fact that not all menu items can be selected.
I seldom work with the front end editing. That's why I did not notice that a publisher in xtd-modal does not see all menu items, which he can click in the font end. But: That was the same with Joomla 3x. I just checked that. Or is there something missing here?