Language Change bug Small PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar chmst
chmst
31 Mar 2023

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

grafik

Expected result AFTER applying this Pull Request

grafik

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

avatar joomla-cms-bot joomla-cms-bot - change - 31 Mar 2023
Category Administration Language & Strings
avatar chmst chmst - open - 31 Mar 2023
avatar chmst chmst - change - 31 Mar 2023
Status New Pending
avatar chmst chmst - change - 31 Mar 2023
The description was changed
avatar chmst chmst - edited - 31 Mar 2023
avatar brianteeman
brianteeman - comment - 31 Mar 2023

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.

avatar Fedik
Fedik - comment - 31 Mar 2023

This is general message, which comes from User class, anytime it cannot find a user

Log::add(Text::sprintf('JLIB_USER_ERROR_UNABLE_TO_LOAD_USER', $id), Log::WARNING, 'jerror');

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 :)

avatar chmst
chmst - comment - 31 Mar 2023

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

avatar brianteeman
brianteeman - comment - 31 Mar 2023

So me need different messages for different cases.

yeah - thats what I am thinking

avatar Fedik
Fedik - comment - 31 Mar 2023

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:

return (bool) $db->setQuery($query)->loadResult();

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.

avatar chmst
chmst - comment - 31 Mar 2023

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?

avatar brianteeman
brianteeman - comment - 31 Mar 2023

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.

avatar Fedik
Fedik - comment - 31 Mar 2023

The rule already in that form (I copied form there), only need to add an attribute message="Blabla validation error"

avatar toivo toivo - test_item - 4 Apr 2023 - Tested successfully
avatar toivo
toivo - comment - 4 Apr 2023

I have tested this item successfully on 8b32598

Tested succcessfully in Joomla 4.3.0-rc3-dev of 4 April using PHP 8.1.16


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

avatar chmst
chmst - comment - 4 Apr 2023

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.

avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 4.4-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
[UX] Improve message when author is deleted
[4.4] Improve message when author is deleted
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar chmst chmst - change - 9 Aug 2024
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
avatar chmst
chmst - comment - 9 Aug 2024

Closing see #41048

avatar chmst chmst - close - 9 Aug 2024

Add a Comment

Login with GitHub to post a comment