User tests: Successful: Unsuccessful:
Pull Request resolves #48253 .
In the admin, several fields let you pick an item through a modal and then edit it in place (article, contact, news feed, category, menu item). Until now these offered an Edit button even when the referenced item was checked out by somebody else.
This patch makes the core field (ModalSelectField) detect that and hide the Edit button, with a note explaining why.
As a second line of defence the field no longer sends a check-in at all for an item it knows to be checked out by someone else, the dialog could not have checked it out, so closing it must not release another user's lock. That covers the cases where the button is reached anyway, for example a select dialog which does not report the state or an item locked between rendering and clicking.
As a user without Global Check-in permission the lock survives either way, but before the patch they were still offered an Edit button.
TBD Backport PR to 5.4-dev
Follow up fixes for https://github.com/joomla/joomla-cms/pull/48300/changes#r3849309890
Prerequisites
admin and tester), or oneSetup - lock an article as another user
tester in a second browser (or a private window).tester. Do not press Save & Close.Verify in Content → Articles that the article now shows the padlock icon.
Test 1 - Edit button is hidden for an item locked by someone else
admin, go to Menus → Site → Add New Menu Item.Test 2 - your own lock does not block you
admin, open Test Article in Content → Articles, then leave via the browser's BackExpected, before and after the patch: the Edit button is shown and works. Only other
users' locks disable it.
Test 3 - selecting a checked-out item hides the Edit button straight away
tester's lock if you hold Global Check-in permission (see Test 4).Test 4 - another user's lock is no longer released behind their back
With Test Article checked out by tester, as admin (a Super User):
tester's lock was released without them noticing, and their next Save & Close fails.tester can still Save & Close normally.Test 5 — an item created or edited through the field is checked in again
Test 6 - no Save button in the dialog for a checked-out item
The dialog edit view can still be reached directly (by URL, or from a select list which does not report the check-out state), and until now it offered Save and Save & Close there. Nothing on the save path stops the write, so pressing Save overwrote the other user's work.
tester, open as admin:/administrator/index.php?option=com_content&view=article&layout=modal&tmpl=component&task=article.edit&id=<articleId>tester's article.view=contact,view=newsfeed, view=category&extension=com_content, view=module, view=plugin). The menuTest 7 - no regression in normal use
Check the article back in first (System → Global Check-in, or Save & Close as tester), then with an article that is not checked out:
name column,Fields covered
The modal field never lives on the item's own edit form. In every case below you open another
item (a menu item, a user note, a plugin) which references the checked-out item through a modal
field - you never open the checked-out item itself.
| Modal field | Form to open (this is where the field lives) | Field label | Item that must be checked out |
|---|---|---|---|
modal_article |
Menus → Site → Add → Menu Item Type: Articles → Single Article | Select Article | an article (Content → Articles) |
modal_article |
System → Plugins → User - Terms of Service | Terms & Conditions Article | an article (Content → Articles) |
modal_contact |
Menus → Site → Add → Menu Item Type: Contacts → Single Contact | Select Contact | a contact (Components → Contacts) |
modal_newsfeed |
Menus → Site → Add → Menu Item Type: News Feeds → Single News Feed | Feed | a news feed (Components → News Feeds) |
modal_category |
Users → User Notes → New | Category | a user note category (Users → User Notes → Categories) |
modal_menu |
Menus → Site → Add → Menu Item Type: System Links → Menu Item Alias | Menu Item | the target menu item (Menus → Site) |
For each row: select the item in the field, save and reopen the form, then check the item out as a
second user and reload the form. Expected after the patch: the Edit button is gone and the note
"Editing is disabled because the item is checked out by another user." is shown. Before the patch
the Edit button is still there.
To be aware of while testing:
edit="false", so it never shows an Edit button — it would look likeChecked out items are editable by another user via the field modal. Check-out is not respected.
Checked out items are not editable by another user and all fields work as expected.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_categories com_contact com_content com_menus com_modules com_newsfeeds Language & Strings Layout Libraries |
| Labels |
Added:
Language Change
PR-6.3-dev
|
||
| Category | Administration com_categories com_contact com_content com_menus com_modules com_newsfeeds Language & Strings Layout Libraries | ⇒ | Administration com_categories com_contact com_content com_menus com_modules com_newsfeeds com_plugins Language & Strings Layout Libraries JavaScript NPM Change |