? ? Pending

User tests: Successful: Unsuccessful:

avatar MacJoom
MacJoom
17 Oct 2022

Pull Request for Issue # 38814
If an article is deleted completely and it is used in a Single Article Menu item then while editing this menu item it is wrongly considered that the article still exits which lead to a wrong modal window when clicking on Edit. The Edit button should no be there

Buttons in the modal window without function #38814

Summary of Changes

in getInput check if article exists with title, change allowed actions to the ones if there was no article

Testing Instructions (taken from #38814)

I create a menu item (single article) and select an existing article.
Then I delete the article (also from the recycle bin)
In the menu management I would now like to select a new article, but at the end it says "Edit" instead of "Select":

Actual result BEFORE applying this Pull Request

'Edit' Button is there

Expected result AFTER applying this Pull Request

The 'Select' and the 'Create' Button are there instead

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • [ x] No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • [x ] No documentation changes for manual.joomla.org needed

avatar MacJoom MacJoom - open - 17 Oct 2022
avatar MacJoom MacJoom - change - 17 Oct 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2022
Category Administration com_content
avatar brianteeman
brianteeman - comment - 17 Oct 2022

It should be obvious that you dont need to set edit = true etc

all you need is

 if (empty($title)) {
             $value = '';
         }
avatar MacJoom
MacJoom - comment - 17 Oct 2022

You are absolutely right... - and it is bad practice anyway to play around with these flags - i will change this

avatar MacJoom MacJoom - change - 17 Oct 2022
Labels Added: ?
avatar brianteeman
brianteeman - comment - 17 Oct 2022

I have tested this item successfully on 9575886


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

avatar brianteeman brianteeman - test_item - 17 Oct 2022 - Tested successfully
avatar alikon
alikon - comment - 18 Oct 2022

I have tested this item successfully on 9575886


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

avatar alikon alikon - test_item - 18 Oct 2022 - Tested successfully
avatar alikon alikon - change - 18 Oct 2022
Status Pending Ready to Commit
avatar alikon
alikon - comment - 18 Oct 2022

RTC


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

avatar bembelimen
bembelimen - comment - 18 Oct 2022

Just a thought writing from mobile:
is it possible to create an article with a title (like "0") where empty is true, although there is an article? So probably we should not check for the title in general but for the ID?

avatar laoneo laoneo - close - 18 Oct 2022
avatar laoneo laoneo - merge - 18 Oct 2022
avatar laoneo laoneo - change - 18 Oct 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-10-18 09:22:29
Closed_By laoneo
Labels Added: ?
avatar brianteeman
brianteeman - comment - 18 Oct 2022

@bembelimen you are correct - checking for the title is a problem - but I would suggest its beyond the scope of this PR.

Other things dont work such as "save to menu" when you have an article with a title of 0

avatar HLeithner
HLeithner - comment - 18 Oct 2022

@MacJoom can you fix this pr by creating a new one? please check what's the result of $db->loadResult() if no record has been found, if it's NULL then check in the if statement for NULL and not for empty() in case it returns an empty string please check for === '' and not for empty(). Also please add a blank line before the if statement.

thanks

avatar MacJoom
MacJoom - comment - 19 Oct 2022

Just a thought writing from mobile: is it possible to create an article with a title (like "0") where empty is true, although there is an article? So probably we should not check for the title in general but for the ID?

$title = $db->loadResult(); of a query looking for the id
so if there is no id, title will be null - and empty does all the checks (for null, '' or not set)

Add a Comment

Login with GitHub to post a comment