User tests: Successful: Unsuccessful:
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
in getInput check if article exists with title, change allowed actions to the ones if there was no article
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":
'Edit' Button is there
The 'Select' and the 'Create' Button are there instead
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
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content |
You are absolutely right... - and it is bad practice anyway to play around with these flags - i will change this
Labels |
Added:
?
|
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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?
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:
?
|
@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
@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
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)
It should be obvious that you dont need to set edit = true etc
all you need is