Skip to content

[staging fix] Class 'ContentHelperAssociation' not found when editing a module in frontend#22518

Merged
mbabker merged 1 commit intojoomla:stagingfrom
infograf768:contenthelperassocmissing
Oct 10, 2018
Merged

[staging fix] Class 'ContentHelperAssociation' not found when editing a module in frontend#22518
mbabker merged 1 commit intojoomla:stagingfrom
infograf768:contenthelperassocmissing

Conversation

@infograf768
Copy link
Member

@infograf768 infograf768 commented Oct 6, 2018

Summary of Changes

Loading the class in SITE/components/com_content/models/articles.php

Testing Instructions

Set a multilingual site.
In Global Configuration allow Inline Editing for Modules & Menus
screen shot 2018-10-06 at 12 23 48

Edit Global Options for Articles and set Show associations to Show
screen shot 2018-10-06 at 12 23 05

Make sure you have some articles associated.

EDIT: Display on the page a mod_latest_news module.

Login frontend as super user and edit a module by clicking on the icon

screen shot 2018-10-06 at 12 27 43

Before patch

Protostar in error and Class 'ContentHelperAssociation' not found (this will show if debug is on)

After patch

All OK.

Note: The class is loaded in 4.0

@infograf768
Copy link
Member Author

Folks, this is quite similar to #22525 in the sense that the issue happens only when editing a module in frontend.

@jsubri
Copy link
Contributor

jsubri commented Oct 8, 2018

I was not able yet to reproduce with a custom template. Can you indicate if the problem occurs with J3.9 Beta 4 or staging?

@infograf768
Copy link
Member Author

please test with protostar. page would display fo rexample a blog with these associated articles.

@csthomas
Copy link
Contributor

csthomas commented Oct 8, 2018

Class ContentHelperAssociation in registered in components/com_content/content.php but modules (latest news) does not load this file. They load only components/com_content/models/articles.php.

@infograf768
Copy link
Member Author

Indeed, just found this happens when that module is present on the page.

@infograf768
Copy link
Member Author

@csthomas
Therefore do you see any other solution than the one proposed in this PR?

@csthomas
Copy link
Contributor

My advice will not help, because I would like to remove the loading associations from the articles.php model and load them only in the views. Because removing associations from the model can be treated as a B/C break, we can not do anything more.

@csthomas
Copy link
Contributor

There was a solution not to load tags for modules, added by Michael, but for associations it may not work. I suppose the modules like (latest news) do not require any associations.

@infograf768
Copy link
Member Author

Indeed, these modules do not need associations.
Therefore, at least for 3.x, this PR is the only solution to keep B/C.
Please set your test OK on issues.joomla.org

@jsubri
Please test again after adding a Latest News module to the page.

@csthomas
Copy link
Contributor

I have tested this item ✅ successfully on 09cb768

To see error I had to set 'Show Associations: Show' in article options.
Use Global (Show) do not work.


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

@infograf768 infograf768 deleted the contenthelperassocmissing branch October 10, 2018 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants