User tests: Successful: Unsuccessful:
Pull Request for Issue # .
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.
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.
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
Category | ⇒ | Administration Language & Strings |
Status | New | ⇒ | Pending |
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.
BTW: my opinion is: Don't allow to delete userentries, just trash and make anonymous.
@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
So me need different messages for different cases.
yeah - thats what I am thinking
It always looks likee a bug when it is not possible to save an article.
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.
I ask myself why we need to check the modified_id? It is overwritten by the current users id on save and has no relevance on other places. Or am I missing something?
A rule on the field looks good.
Agreed - a nice solution that allows better error messages
I ask myself why we need to check the modified_id? It is overwritten by the current users id on save and has no relevance on other places. Or am I missing something?
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 message="Blabla validation error"
I have tested this item
Tested succcessfully in Joomla 4.3.0-rc3-dev of 4 April using PHP 8.1.16
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.
Title |
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-08-09 20:40:14 |
Closed_By | ⇒ | chmst | |
Labels |
Added:
Language Change
bug
Small
PR-4.4-dev
|
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.