User tests: Successful: Unsuccessful:
This PR refactors the views to get the model object and then directly call the methods of the model instead of going through the View::get() indirection. This refactors the views of the backend components from com_actionlogs to com_finder.
Everything should work the same.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_associations com_categories com_checkin com_config com_contact com_content com_contenthistory com_fields com_finder |
Can we then not deprecate the get function?
I'm open for this, but that would be out of scope for this PR.
| Labels |
Added:
PR-5.3-dev
|
||
| Category | Administration com_associations com_categories com_checkin com_config com_contact com_content com_contenthistory com_fields com_finder | ⇒ | Administration com_associations com_banners com_cache com_categories com_checkin com_config com_contact com_content com_contenthistory com_fields com_finder |
| Status | Pending | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-10-01 07:29:11 |
| Closed_By | ⇒ | laoneo |
Thanks!
This pull request includes several changes across multiple files to refactor the way models are used within the
HtmlViewclasses. The main goal is to standardize how data is retrieved by using model methods instead of direct calls within the view. Below are the most important changes grouped by theme:Refactoring to Use Models in Views
administrator/components/com_associations/src/View/Associations/HtmlView.php: Replaced direct calls togetmethods with corresponding methods fromAssociationsModel. [1] [2] [3]administrator/components/com_categories/src/View/Categories/HtmlView.php: Updated to useCategoriesModelfor retrieving state, items, pagination, and other data.administrator/components/com_categories/src/View/Category/HtmlView.php: Switched to usingCategoryModelfor form, item, state, and associated data. [1] [2]administrator/components/com_checkin/src/View/Checkin/HtmlView.php: Modified to useCheckinModelfor items, pagination, state, total, and filters.administrator/components/com_config/src/View/Application/HtmlView.php: Changed to useApplicationModelfor form, data, and user information.administrator/components/com_config/src/View/Component/HtmlView.php: Updated to useComponentModelfor component and form data.administrator/components/com_contact/src/View/Contact/HtmlView.php: Refactored to useContactModelfor form, item, and state. [1] [2]administrator/components/com_contact/src/View/Contacts/HtmlView.php: Adjusted to useContactsModelfor items, pagination, state, and filters.administrator/components/com_content/src/View/Article/HtmlView.php: Updated to useArticleModelfor form, item, and state. [1] [2]administrator/components/com_content/src/View/Articles/HtmlView.php: Refactored to useArticlesModelfor items, pagination, state, and filters. [1] [2]Adding Model Imports
administrator/components/com_associations/src/View/Associations/HtmlView.php: AddedAssociationsModelimport.administrator/components/com_categories/src/View/Categories/HtmlView.php: AddedCategoriesModelimport.administrator/components/com_categories/src/View/Category/HtmlView.php: AddedCategoryModelimport.administrator/components/com_checkin/src/View/Checkin/HtmlView.php: AddedCheckinModelimport.administrator/components/com_config/src/View/Application/HtmlView.php: AddedApplicationModelimport.administrator/components/com_config/src/View/Component/HtmlView.php: AddedComponentModelimport.administrator/components/com_contact/src/View/Contact/HtmlView.php: AddedContactModelimport.administrator/components/com_contact/src/View/Contacts/HtmlView.php: AddedContactsModelimport.administrator/components/com_content/src/View/Article/HtmlView.php: AddedArticleModelimport.administrator/components/com_content/src/View/Articles/HtmlView.php: AddedArticlesModelimport.administrator/components/com_content/src/View/Featured/HtmlView.php: AddedFeaturedModelimport.(this was a test to see if the copilot generated descriptions are helpful)