? Success
Related to # 4737

User tests: Successful: Unsuccessful:

avatar maxvalentini77
maxvalentini77
22 Aug 2014

Cannot change read/unread status on messages or delete them

The read/unread status on messages (http://...website.../administrator/index.php?option=com_messages) cannot be changed after the user has updated his profile (http://...website.../administrator/index.php?option=com_admin&view=profile&layout=edit&id=#user_id#).
Also a message cannot be deleted after the user has updated his profile.

The warning "Edit state is not permitted" is shown if try to change the read/unread status.
The warning "Delete not permitted" is shown if try to delete a message.

How to reproduce the bug

1: Login in the backend side, and go to the message list view using the menu "Componentes > Messaging", ensure that you have at least one message.

2: Now you can change the read/unread state of the message or delete them.

  • try select a message and press the button "Mark As Read" or "Mark As Unread"
  • try use the link in the column "read"
  • try select a message and press the button "Empty trash" (must have the filter "Trashed").

3: Use the top-right menu and go to "Edit Account" (you don't need to change anything).

4: Press "Save & Close"

5: Return to the message list view using the menu "Componentes > Messaging".

6: Now you cannot change the read/unread state of the message or delete them (logout/login to make it work again).

  • try select a message and press the button "Mark As Read" or "Mark As Unread"
  • try use the link in the column "read"
  • try select a message and press the button "Empty trash" (must have the filter "Trashed").

Note that the point "2" is not relevant on the result of point "6".

avatar maxvalentini77 maxvalentini77 - open - 22 Aug 2014
avatar jissues-bot jissues-bot - change - 22 Aug 2014
Status Pending New
Labels Added: ?
avatar roland-d
roland-d - comment - 23 Aug 2014

Hello @maxvalentini77

I believe your fix is not correct as we need the !== operator because the user ID could be false or null. @phproberto and @Bakual Can you confirm?

While looking into your issue I found the root cause of this problem to be in the user profile code which removed the usergroups. This I have fixed in PR #4159. After I made those changes, the messaging started to work again as expected.

Thanks.

avatar maxvalentini77
maxvalentini77 - comment - 23 Aug 2014

Hello,

The root problem is that after the call of method bind($data) on the JUser object the id property became of type "int", after load is of type "string".

The property $table->user_id_to are of type string so the check fail due to "888" !== 888 is true!
This is the reason why i change the operator "!==" with "!=".
I think $user->id can't be null or false in that point of code because you must be logged to access that view/controller.

I can confirm that the PR #4159 fix this problem because remove the call to bind method.

Thanks to you.

avatar maxvalentini77
maxvalentini77 - comment - 23 Aug 2014

UPDATE

After applying the PR #4159 on my 3.3.3 version i can't change any property using the profile page.
Method bind must be called, the param of save function is not the data to bind on it.

I think there is still need my fix.

avatar roland-d
roland-d - comment - 23 Aug 2014

@maxvalentini77 You are correct, the bind method is needed because $user is an instance of JUser, not of the User table class. PR #4159 is closed now.

avatar brianteeman brianteeman - change - 23 Aug 2014
Status New Pending
avatar phproberto
phproberto - comment - 6 Sep 2014

@test works as expected. Thanks!

P.S: Never use staging branch :neckbeard:

avatar maxvalentini77
maxvalentini77 - comment - 6 Sep 2014

I'm sorry, which branch should I use?

avatar phproberto
phproberto - comment - 6 Sep 2014

Sorry about the confusion. I mean your local staging branch. You should keep that clean and updated with the remote staging branch. To work on something and submit a PR create a new branch.

avatar maxvalentini77
maxvalentini77 - comment - 7 Sep 2014

Thank for the advice

avatar zero-24 zero-24 - change - 27 Sep 2014
Category Administration Components
avatar nicksavov nicksavov - change - 16 Oct 2014
Labels Added: ?
avatar redcomponent
redcomponent - comment - 17 Oct 2014

Can not test this one i am getting this error:

Error
The patch could not be applied because the repository is missing

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

avatar brianteeman brianteeman - change - 17 Oct 2014
Status Pending Closed
Rel_Number 4737
Relation Type Related to
avatar brianteeman
brianteeman - comment - 17 Oct 2014

In error @maxvalentini77 has removed his branch so the code is not there. I have replicated his PR at #4737

avatar jissues-bot
jissues-bot - comment - 17 Oct 2014
avatar jissues-bot jissues-bot - close - 17 Oct 2014
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Closed_Date 0000-00-00 00:00:00 2014-10-17 08:40:15
avatar maxvalentini77
maxvalentini77 - comment - 17 Oct 2014

Sorry for the inconvenience.

Add a Comment

Login with GitHub to post a comment