-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.4] Improve message when author is deleted #40269
base: 4.4-dev
Are you sure you want to change the base?
Conversation
This works correctly for the author field However it displays the same message for the modified field. That one cannot be corrected as its readonly. Just saving the article fixes that one. |
This is general message, which comes from User class, anytime it cannot find a user joomla-cms/libraries/src/User/User.php Line 819 in 1e7527b
To me, this message should not be show up, maximum just logged. But in past someone complain "that it is right to show it up". I do not remember detail anymore :) |
There were long discussions and and as long as we don't have a solution how to process deletion of users, We could only improve the message. @brianteeman thanks, I did not see that. So me need different messages for different cases. @Fedik It always looks likee a bug when it is not possible to save an article. So the user must know why. It looks more as an error than a warning |
yeah - thats what I am thinking |
Yeah I understood. I think it can be a message for each user field. Kind of: <field
name="created_by"
type="user"
label="COM_CONTENT_FIELD_CREATED_BY_LABEL"
validate="UserId"
message="A valid User ID is required, please make sure User is selected."
/> Or globaly, throw an exception here:
if (!$db->setQuery($query)->loadResult()) {
throw new RuntimeException('Blablabla user id is wrong');
}
return true; Both approaches can work, but first one allow to have a specific message per form field. |
A rule on the field looks good. |
Agreed - a nice solution that allows better error messages
It might be useful to know that the last person who modified the content is no longer an active member. But only as an information. |
The rule already in that form (I copied form there), only need to add an attribute |
I have tested this item ✅ successfully on 8b32598 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40269. |
Sorry to say that but this pr is not ready and I set it to draft. The messag is misleading if the modified_by user is deleted. |
This pull request has been automatically rebased to 4.4-dev. |
Pull Request for Issue # .
Summary of Changes
If a user record has been deleted his articles cannot be stored any more. Now the message says what the user can do to solve the problem.
Testing Instructions
Simplest way:
Open #__content table and change the created_by id of an article to a non-existing userId.
Then try to change this article in the backend.
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
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:
No documentation changes for manual.joomla.org needed