Skip to content

[5.3] Deprecate AbstractView::get()#44162

Merged
laoneo merged 4 commits intojoomla:5.3-devfrom
Hackwar:5.3-view-get
Oct 5, 2024
Merged

[5.3] Deprecate AbstractView::get()#44162
laoneo merged 4 commits intojoomla:5.3-devfrom
Hackwar:5.3-view-get

Conversation

@Hackwar
Copy link
Member

@Hackwar Hackwar commented Sep 30, 2024

Summary of Changes

In a time far far away, someone thought it might be a good idea to introduce an indirection in the view to get the data from the model by adding AbstractView::get(), which retrieves the model and then runs get<Parameter>() on the model. This removes any chance of typehinting, etc. and makes everything unnecessarily complex, so we are deprecating this method with this PR.

The new way hence forth shall be for example:

    public function display($tpl = null)
    {
        $model = $this->getModel();
        $this->items = $model->getItems();

        parent::display($tpl);
    }

Testing Instructions

Codereview

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: Removing AbstractView::get() Manual#318

  • No documentation changes for manual.joomla.org needed

@laoneo
Copy link
Member

laoneo commented Oct 2, 2024

Can you make here the manual entry as well?

@Hackwar
Copy link
Member Author

Hackwar commented Oct 3, 2024

The PR for manual.joomla.org has been created and linked. The question is how to get all the occurences of this in docs.joomla.org removed? Since there are plans on changing docs.joomla.org, should we change it there now?

@Hackwar
Copy link
Member Author

Hackwar commented Oct 3, 2024

I added a deprecation trigger to the method.

Hackwar and others added 2 commits October 4, 2024 11:49
@laoneo laoneo merged commit 81e2a58 into joomla:5.3-dev Oct 5, 2024
@laoneo
Copy link
Member

laoneo commented Oct 5, 2024

Thanks!

@laoneo laoneo added this to the Joomla! 5.3.0 milestone Oct 5, 2024
brbrbr added a commit to brbrbr/Blc that referenced this pull request Oct 8, 2024
brbrbr added a commit to brbrbr/Blc that referenced this pull request Oct 8, 2024
@Hackwar Hackwar deleted the 5.3-view-get branch June 10, 2025 17:44
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.

4 participants