No Code Attached Yet
avatar JoeJoomla
JoeJoomla
19 Aug 2021

Steps to reproduce the issue

In a fresh Joomla 4 install create a new category called 'Blog'. You should now have two categories; category id=2 for 'uncategorized' and id=8 for 'blog' category.

Go to the main dashboard and use the following URL structure in the browser window (or create a link in a custom admin module to click) to open an 'Add Article' in the blog category (assuming id=8 is blog category):

/administrator/index.php?option=com_content&filter[category_id]=8&view=article&layout=edit

This may work as expected the first time but if you then try to directly open a new article editor window in the uncategorized id=2 category you likely will get the blog category instead.

So on a subsequent try, with id=2 for 'uncategorized' and id=8 for 'blog'' category, put the URL in the browser (or click the link you made with the URL in it) for:

/administrator/index.php?option=com_content&filter[category_id]=8&view=article&layout=edit

Expected result

A new article editor window should open with the blog category already selected.

Actual result

A new window is opened with the category 'uncategorized' selected instead of the 'blog' category

open-new-article-in-specific-category

System information (as much as possible)

Joomla! 4.0.0 Stable
PHP 7.3.29
Database 5.7.33-cll-lve

Additional comments

avatar JoeJoomla JoeJoomla - open - 19 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 19 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Aug 2021
avatar PhilETaylor
PhilETaylor - comment - 19 Aug 2021

http://example.com/administrator/index.php?option=com_content&view=article&layout=edit&catid=2
http://example.com/administrator/index.php?option=com_content&view=article&layout=edit&catid=8

These work for me. On the edit view you need to use catid, on the list view you can use filter[category_id]

Because of this code:

// Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles

$data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null)));

avatar JoeJoomla JoeJoomla - change - 19 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-19 17:50:34
Closed_By JoeJoomla
avatar JoeJoomla JoeJoomla - close - 19 Aug 2021
avatar JoeJoomla
JoeJoomla - comment - 19 Aug 2021

Thank you Phil, that does indeed work. I'll close up this issue now.

Add a Comment

Login with GitHub to post a comment