PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
27 Sep 2024

Summary of Changes

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.

Testing Instructions

Everything should work the same.

Link to documentations

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

avatar Hackwar Hackwar - open - 27 Sep 2024
avatar Hackwar Hackwar - change - 27 Sep 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Sep 2024
Category Administration com_associations com_categories com_checkin com_config com_contact com_content com_contenthistory com_fields com_finder
avatar brianteeman
brianteeman - comment - 27 Sep 2024

This pull request includes several changes across multiple files to refactor the way models are used within the HtmlView classes. 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 to get methods with corresponding methods from AssociationsModel. [1] [2] [3]
  • administrator/components/com_categories/src/View/Categories/HtmlView.php: Updated to use CategoriesModel for retrieving state, items, pagination, and other data.
  • administrator/components/com_categories/src/View/Category/HtmlView.php: Switched to using CategoryModel for form, item, state, and associated data. [1] [2]
  • administrator/components/com_checkin/src/View/Checkin/HtmlView.php: Modified to use CheckinModel for items, pagination, state, total, and filters.
  • administrator/components/com_config/src/View/Application/HtmlView.php: Changed to use ApplicationModel for form, data, and user information.
  • administrator/components/com_config/src/View/Component/HtmlView.php: Updated to use ComponentModel for component and form data.
  • administrator/components/com_contact/src/View/Contact/HtmlView.php: Refactored to use ContactModel for form, item, and state. [1] [2]
  • administrator/components/com_contact/src/View/Contacts/HtmlView.php: Adjusted to use ContactsModel for items, pagination, state, and filters.
  • administrator/components/com_content/src/View/Article/HtmlView.php: Updated to use ArticleModel for form, item, and state. [1] [2]
  • administrator/components/com_content/src/View/Articles/HtmlView.php: Refactored to use ArticlesModel for items, pagination, state, and filters. [1] [2]

Adding Model Imports

  • administrator/components/com_associations/src/View/Associations/HtmlView.php: Added AssociationsModel import.
  • administrator/components/com_categories/src/View/Categories/HtmlView.php: Added CategoriesModel import.
  • administrator/components/com_categories/src/View/Category/HtmlView.php: Added CategoryModel import.
  • administrator/components/com_checkin/src/View/Checkin/HtmlView.php: Added CheckinModel import.
  • administrator/components/com_config/src/View/Application/HtmlView.php: Added ApplicationModel import.
  • administrator/components/com_config/src/View/Component/HtmlView.php: Added ComponentModel import.
  • administrator/components/com_contact/src/View/Contact/HtmlView.php: Added ContactModel import.
  • administrator/components/com_contact/src/View/Contacts/HtmlView.php: Added ContactsModel import.
  • administrator/components/com_content/src/View/Article/HtmlView.php: Added ArticleModel import.
  • administrator/components/com_content/src/View/Articles/HtmlView.php: Added ArticlesModel import.
  • administrator/components/com_content/src/View/Featured/HtmlView.php: Added FeaturedModel import.

(this was a test to see if the copilot generated descriptions are helpful)

avatar laoneo
laoneo - comment - 30 Sep 2024

Can we then not deprecate the get function?

avatar Hackwar
Hackwar - comment - 30 Sep 2024

I'm open for this, but that would be out of scope for this PR.

avatar Hackwar
Hackwar - comment - 30 Sep 2024

See #44162

avatar Hackwar Hackwar - change - 30 Sep 2024
Labels Added: PR-5.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 30 Sep 2024
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
avatar laoneo laoneo - change - 1 Oct 2024
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-10-01 07:29:11
Closed_By laoneo
avatar laoneo laoneo - close - 1 Oct 2024
avatar laoneo laoneo - merge - 1 Oct 2024
avatar laoneo
laoneo - comment - 1 Oct 2024

Thanks!

Add a Comment

Login with GitHub to post a comment