Language Change PR-4.3-dev ? Pending

User tests: Successful: Unsuccessful:

avatar sandewt
sandewt
1 Oct 2020

Pull Request for Issue # .

New feature, see #30767

Summary of Changes

There is a message after a successfully login and logout in the frontend.

Messages

new_feature_messages_3
new_feature_messages_2
[EDIT] Removed successfully from the text in message.

Users: Options

new_feature_messages_4
[EDIT] Removed

Testing Instructions

Backend: Go to Users > Manage > Options
(Frontend: Is not applicable.)

Set the options:

  • Frontend Login Message (= Yes, default = No)
  • Frontend Logout Message (= Yes, default = No)

Create a menu link:

  • Menu Login form
  • Menu Logout form
  1. Log in and out, in case of a:
  • Login form (default)
  • Menu Login form
  • Menu Logout form
  1. Code review (developers);
  • Check if the code is correct and secure.

Actual result BEFORE applying this Pull Request

There is NOT showing a message after a suscessfully login or logout.

Expected result AFTER applying this Pull Request

  • There is showing a message after a suscessfully login.
  • There is showing a message after a suscessfully logout.

Documentation Changes Required

Yes.

avatar sandewt sandewt - open - 1 Oct 2020
avatar sandewt sandewt - change - 1 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2020
Category Front End com_users
avatar sandewt sandewt - change - 1 Oct 2020
Title
Message after a login / logout
[4.] Message after a login / logout
avatar sandewt sandewt - edited - 1 Oct 2020
avatar sandewt sandewt - change - 1 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2020
Category Front End com_users Administration com_users Front End
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2020
Category Front End com_users Administration Administration com_users Language & Strings Front End
avatar sandewt sandewt - change - 1 Oct 2020
Labels Added: ?
avatar HLeithner
HLeithner - comment - 1 Oct 2020

Please rebase on 4.1-dev

avatar sandewt sandewt - change - 1 Oct 2020
Title
[4.] Message after a login / logout
[4.x] Message after a login / logout
avatar sandewt sandewt - edited - 1 Oct 2020
avatar sandewt sandewt - change - 1 Oct 2020
The description was changed
avatar sandewt sandewt - edited - 1 Oct 2020
avatar sandewt sandewt - change - 1 Oct 2020
Title
[4.x] Message after a login / logout
[4.0] Message after a login / logout
avatar sandewt sandewt - edited - 1 Oct 2020
avatar sandewt
sandewt - comment - 1 Oct 2020

Please rebase on 4.1-dev

It's just a small extension, a new feature might be a bit exaggerated. Or is there some other argument?


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

avatar sandewt sandewt - change - 1 Oct 2020
Title
[4.0] Message after a login / logout
[4.0] Message after a login / logout frontend
avatar sandewt sandewt - edited - 1 Oct 2020
avatar sandewt sandewt - change - 1 Oct 2020
The description was changed
avatar sandewt sandewt - edited - 1 Oct 2020
avatar sandewt sandewt - change - 1 Oct 2020
The description was changed
avatar sandewt sandewt - edited - 1 Oct 2020
avatar maikol-ortigueira maikol-ortigueira - test_item - 1 Oct 2020 - Tested successfully
avatar maikol-ortigueira
maikol-ortigueira - comment - 1 Oct 2020

I have tested this item successfully on 963ad7d

I have tested the patch and it works perfectly


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

avatar pabloarias pabloarias - test_item - 1 Oct 2020 - Tested successfully
avatar pabloarias
pabloarias - comment - 1 Oct 2020

I have tested this item successfully on 963ad7d

Tested successfully on Joomla 4.0.0-beta5-dev and PHP 7.3.22-1

Thank you!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.
avatar sandewt sandewt - change - 1 Oct 2020
The description was changed
avatar sandewt sandewt - edited - 1 Oct 2020
avatar alikon
alikon - comment - 1 Oct 2020

i'll not set this PR as RTC despite 2 good tests cause of #30834 (comment)
i'll let the final decision to RL's

avatar brianteeman
brianteeman - comment - 1 Oct 2020

We might as well all go home if this wont get merged

avatar sandewt
sandewt - comment - 1 Oct 2020

Some checks were not successful: continuous-integration/drone/pr — Build is failing

What does this mean? Action?

[EDIT] I see that this problem has resolved itself.

avatar HLeithner
HLeithner - comment - 1 Oct 2020

We might as well all go home if this wont get merged

We have 27 release blocker and most of the time I only see some new stuff if no one fixes the release blocker and only add new fancy stuff then you are right and we can go home.
https://github.com/joomla/joomla-cms/issues?q=is%3Aopen+is%3Aissue+label%3A"Release+Blocker"

avatar sandewt
sandewt - comment - 2 Oct 2020

We have 27 release blocker and most of the time I only see some new stuff if no one fixes the release blocker and only add new fancy stuff then you are right and we can go home.

I will close this PR and make a new PR based on [4.1].

avatar HLeithner
HLeithner - comment - 2 Oct 2020

You don't need to, I changed your target branch to 4.1-dev

avatar sandewt
sandewt - comment - 2 Oct 2020

You don't need to, I changed your target branch to 4.1-dev

I see it has already happened. 😃

Thanks.

avatar sandewt sandewt - change - 2 Oct 2020
Title
[4.0] Message after a login / logout frontend
[4.1] Message after a login / logout frontend
avatar sandewt sandewt - edited - 2 Oct 2020
avatar sandewt
sandewt - comment - 14 Oct 2020

Please rebase on 4.1-dev

Please test in Joomla [4.1].

@maikol-ortigueira / @pabloarias


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

avatar tushar33 tushar33 - test_item - 17 Oct 2020 - Tested successfully
avatar tushar33
tushar33 - comment - 17 Oct 2020

I have tested this item successfully on 91ccc4f


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

avatar particthistle particthistle - test_item - 1 Nov 2020 - Tested successfully
avatar particthistle
particthistle - comment - 1 Nov 2020

I have tested this item successfully on 91ccc4f

Nice addition @sandewt. Too many times have I not realised I was logged in or out when wanting to be the reverse after clicking the button in J3.

Testing scenarios all worked.

Please add Documentation Required tag so that it can be noted to go back and review relevant help and JDocs.


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

avatar alikon alikon - change - 1 Nov 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 1 Nov 2020

RTC


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

avatar bembelimen
bembelimen - comment - 3 Nov 2020

I really like the feature (good idea) but I'm not sure about the parameter tbh. Is it needed at all? Perhaps we should (in a future version) go for a message management extension where all this notifications can be managed on one point?
Any thoughts?

avatar zero-24
zero-24 - comment - 3 Nov 2020

What kind of message management extension are you looking for? Shouldt a module / plugin / component take care of its own messages?

avatar brianteeman
brianteeman - comment - 3 Nov 2020

Something like the mail templates?

avatar bembelimen
bembelimen - comment - 3 Nov 2020

Yes exactly.

avatar snehaM26 snehaM26 - test_item - 7 Nov 2020 - Tested successfully
avatar snehaM26
snehaM26 - comment - 7 Nov 2020

I have tested this item successfully on 91ccc4f

I have tested this item.


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

avatar ashvini77 ashvini77 - test_item - 7 Nov 2020 - Tested successfully
avatar ashvini77
ashvini77 - comment - 7 Nov 2020

I have tested this item successfully on 91ccc4f

Its showing a message on login and logout on frontend.


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

avatar sandewt
sandewt - comment - 13 Nov 2020

Thanks all.

avatar bembelimen
bembelimen - comment - 15 Nov 2020

Again: I would merge it, but I think the parameter are not necessary. We should avoid to add parameter for each thing (yeah I know we did it in the past very often...). If someone want to disable the messages, he/she/it can just make a language override to an empty string.

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

Could you adjust the PR for this?

avatar sandewt
sandewt - comment - 15 Nov 2020

Again: I would merge it, I would merge it, but I think the parameter are not necessary.

Sorry, I read about this. Do you mean both parameters?
For now I would like to leave it that way, until there is a centrally regulated message system. Or if several want it that way.

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

You mean?

Change this code:

// Show a message when a user is logged in.
if ($login === 1 && Factory::getUser()->get('id') > 0)

to:

// Show a message when a user is logged in.
if (ComponentHelper::getParams('com_users')->get('frontend_login_message', 0))
{
avatar bembelimen
bembelimen - comment - 15 Nov 2020

Do you mean both parameters?

Yes both parameters.

avatar sandewt
sandewt - comment - 18 Nov 2020

If someone want to disable the messages, he/she/it can just make a language override to an empty string.

I have the following notes:

  1. Not everyone likes a login / outlog message and can get irritated by it. Hence the default parameters are hide.
  2. Especially novice users of Joomla are often unfamiliar with overrides.
avatar sandewt sandewt - change - 30 Nov 2020
Labels Added: ? ?
Removed: ?
avatar sandewt
sandewt - comment - 30 Nov 2020

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

Done. Deleted check if user is logged in


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

avatar Quy Quy - change - 4 Dec 2020
Status Ready to Commit Pending
avatar Tejashrimajage Tejashrimajage - test_item - 5 Dec 2020 - Tested successfully
avatar Tejashrimajage
Tejashrimajage - comment - 5 Dec 2020

I have tested this item successfully on ce1bf61

It's working fine.


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

avatar vaibhavsTekdi vaibhavsTekdi - test_item - 5 Dec 2020 - Tested successfully
avatar vaibhavsTekdi
vaibhavsTekdi - comment - 5 Dec 2020

I have tested this item successfully on ce1bf61


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

avatar HLeithner
HLeithner - comment - 5 Dec 2020

@sandewt please remove the parameters they are unneeded and using the override component should be possible with documentation thx

avatar richard67 richard67 - change - 13 Nov 2021
Status Pending Needs Review
avatar richard67
richard67 - comment - 13 Nov 2021

Needs some change as stated above.


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

avatar richard67
richard67 - comment - 13 Nov 2021

Needs some change as stated above.


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

avatar sandewt sandewt - change - 12 Dec 2021
Labels Added: Language Change ? ?
Removed: ? ? ? ?
avatar sandewt
sandewt - comment - 12 Dec 2021

Removed: ? ? ? ?

See #30834 (comment)


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

avatar sandewt sandewt - change - 12 Dec 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 12 Dec 2021
Category Front End com_users Administration Language & Strings Front End com_users Language & Strings
avatar richard67 richard67 - change - 12 Dec 2021
Status Needs Review Pending
avatar richard67
richard67 - comment - 12 Dec 2021

Back to pending.


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

avatar sandewt
sandewt - comment - 12 Dec 2021

Back to pending.

@HLeithner and @bembelimen

Deleted the two parameters.


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

avatar sandewt
sandewt - comment - 14 Jan 2022

Please test.

  • Install the patch.
  • Login and logout and see the messages.

That's all, the options have been removed.

avatar Quiviro
Quiviro - comment - 21 Jan 2022

I have tested this item successfully on 61634a3

The messages are shown after login/logout


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

avatar Quiviro Quiviro - test_item - 21 Jan 2022 - Tested successfully
avatar BertaOctech
BertaOctech - comment - 21 Jan 2022

I have tested this item 🔴 unsuccessfully on 61634a3

I am sorry but after applyingg the patch I do not see the messages

I am testing on 4.1.0-rc1

Some system info:

Database Type mysql
Database Version 10.4.19-MariaDB
Database Collation utf8mb4_general_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 7.4.20
Web Server Apache/2.4.48 (Unix) OpenSSL/1.1.1k PHP/7.4.20 mod_perl/2.0.11 Perl/v5.32.1
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 4.1.0-rc1 Release Candidate [ Kuamini ] 18-January-2022 18:00 GMT
User Agent Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0
---------------


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

avatar BertaOctech BertaOctech - test_item - 21 Jan 2022 - Tested unsuccessfully
avatar sandewt
sandewt - comment - 23 Jan 2022

I am sorry but after applyingg the patch I do not see the messages
I am testing on 4.1.0-rc1

I have no explanation for this.

Can you test with Joomla! 4.1.0-dev Development [ Kuamini ] ?

[EDIT] I have tested successfully on: Joomla! 4.1.0-rc1 Release Candidate [ Kuamini ] 18-January-2022 18:00 GMT

avatar BertaOctech
BertaOctech - comment - 23 Jan 2022

Hi again.

I am sorry but could not test the patch successfully.

I took a fresh install from https://developer.joomla.org/nightly-builds.html
I configured the patch tester but for some reason the oldest pull id available to me was #36134

I then tried to apply the patch manually but I did not get the expected result.

Best regards,

Berta

avatar pabloarias pabloarias - test_item - 4 Feb 2022 - Tested successfully
avatar pabloarias
pabloarias - comment - 4 Feb 2022

I have tested this item successfully on 61634a3

Hello:

My currently installed Joomla! version is ‎4.1.0-rc3-dev. I'm using PHP 8.0.15.

I've created a menu item to login and another to logout.

Before apply path: it doesn't show messages after login or logout.

After applying the path: it shows a message in both cases. After login and logout. Via module or menu items.

Thank you!


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

avatar infograf768 infograf768 - test_item - 5 Feb 2022 - Tested successfully
avatar infograf768
infograf768 - comment - 5 Feb 2022

I have tested this item successfully on 61634a3


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

avatar infograf768 infograf768 - change - 5 Feb 2022
Status Pending Ready to Commit
Easy No Yes
avatar infograf768
infograf768 - comment - 5 Feb 2022

rtc


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

avatar sandewt
sandewt - comment - 5 Feb 2022

Thanks all. 😃

avatar sandewt sandewt - change - 15 Feb 2022
Labels Added: ?
avatar sandewt
sandewt - comment - 15 Feb 2022

Oops, I see that this feature is not yet added to J4.1.
So, I have merged this branche.

avatar sandewt
sandewt - comment - 11 Mar 2022

@richard67

Why is this PR not merged to the core yet?

avatar richard67
richard67 - comment - 11 Mar 2022

@sandewt No idea. I am not the only maintainer.

avatar laoneo laoneo - change - 11 Mar 2022
Title
[4.1] Message after a login / logout frontend
[4.2] Message after a login / logout frontend
avatar laoneo laoneo - edited - 11 Mar 2022
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2022
Category Front End com_users Language & Strings Administration com_finder com_installer com_media com_newsfeeds Language & Strings Modules Repository NPM Change Front End com_contact com_users Layout Libraries Plugins
avatar laoneo
laoneo - comment - 11 Mar 2022

This change should go into 4.2. I changed the base branch, but now there are some commits added to your pr which will disappear when 4.1 got fully merged up into 4.2.

avatar richard67
richard67 - comment - 11 Mar 2022

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

Done. Deleted check if user is logged in

@sandewt I see the check has been deleted in the login method but not in the logout method. Does that have a reason, or was that just missed?

avatar laoneo laoneo - change - 11 Mar 2022
Labels Added: NPM Resource Changed ?
avatar sandewt
sandewt - comment - 12 Mar 2022

@richard67 A good comment.
I don't know if there is a check somewhere in Joomla if the user is really logged out at that time. I'll go for safety then.

avatar bembelimen bembelimen - change - 12 Mar 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 12 Mar 2022
Category Front End com_users Language & Strings Administration com_finder com_installer com_media com_newsfeeds Modules Repository NPM Change com_contact Layout Libraries Plugins Front End com_users Language & Strings
avatar bembelimen
bembelimen - comment - 12 Mar 2022

@richard67 A good comment. I don't know if there is a check somewhere in Joomla if the user is really logged out at that time. I'll go for safety then.

No need to be "safe" here, as if the logout failed, it would have been caught before. Although the check would be: if ($app->getIdentity()->guest) (we shouldn't introduce deprecated code) but as mentioned it's not needed.

avatar sandewt sandewt - change - 15 Mar 2022
Labels Removed: NPM Resource Changed
avatar richard67
richard67 - comment - 15 Mar 2022

@bembelimen @laoneo Do you think we need new tests after the last 2 commits?

avatar laoneo
laoneo - comment - 15 Mar 2022

I think one test for confirmation is enough

avatar sandewt
sandewt - comment - 15 Mar 2022

I think one test for confirmation is enough

@laoneo I think not

echo Factory::getUser()->get('guest') . '<br>'; // let's see 1
echo Factory::getUser()->get('id') . '<br>'; // let's see  0
echo $app->getIdentity()->guest  . '<br>'; // let's see 0
echo $app->getIdentity()->id; // let's NOT see 0
avatar laoneo
laoneo - comment - 15 Mar 2022

Are you also talking about the human tests for this pr?

avatar richard67
richard67 - comment - 15 Mar 2022

I was indeed only talking about human tests.

avatar sandewt
sandewt - comment - 15 Mar 2022

I think this PR is not successful for the above reasons. Please test.

avatar sandewt
sandewt - comment - 15 Mar 2022

In summary:

When using this method, the user IS logged out (there is a logout message).

if (Factory::getUser()->get('guest'))

And when using the following method, the user is NOT logged out (there is no logout message).

if ($app->getIdentity()->guest)

Is completely unclear to me.

avatar bembelimen
bembelimen - comment - 15 Mar 2022

Just make it easy: remove the if... messages are enough

avatar sandewt
sandewt - comment - 16 Mar 2022

Just make it easy: remove the if... messages are enough

The moment the message 'You have been logged out.' is generated, the user is actually still logged in.
This is equivalent to flying the flag before finishing.
Of course, somewhere in the logout process, things will be checked, but still.

That's why I'm hesitating to drop the if statement. Give me a good reason to remove it.

avatar roland-d
roland-d - comment - 17 Mar 2022

@sandewt

The moment the message 'You have been logged out.' is generated, the user is actually still logged in.

That is not the case right, the logout is called before that on line 167
https://github.com/joomla/joomla-cms/pull/30834/files#diff-d3df0595ae1fa944f7270d2b86a20ae9358c93d7206c2191da23aebd8ce585a0R167

Do you want to figure out the discrepancies between getting the guest status?

Your comment here #30834 (comment) may need some further investigation in a separate issue.

avatar joomla-bot
joomla-bot - comment - 27 Jun 2022

This pull requests has been automatically converted to the PSR-12 coding standard.

avatar richard67 richard67 - change - 28 Jun 2022
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 28 Jun 2022

Back to pending (RTC was added back by the bot by accident).


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

avatar laoneo laoneo - change - 21 Oct 2022
Labels Added: ? ?
Removed: ?
avatar laoneo laoneo - change - 21 Oct 2022
Title
[4.2] Message after a login / logout frontend
[4.3] Message after a login / logout frontend
avatar laoneo laoneo - edited - 21 Oct 2022
avatar drmenzelit drmenzelit - change - 22 Oct 2022
Labels Added: PR-4.3-dev
Removed: ? ?
avatar drmenzelit drmenzelit - change - 22 Oct 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-10-22 16:49:58
Closed_By drmenzelit
avatar drmenzelit drmenzelit - close - 22 Oct 2022
avatar drmenzelit drmenzelit - merge - 22 Oct 2022
avatar drmenzelit
drmenzelit - comment - 22 Oct 2022

Thanks

avatar sandewt
sandewt - comment - 23 Oct 2022

Your comment here #30834 (comment) may need some further investigation in a separate issue.

@drmenzelit

Something went wrong here. This PR is merged to joomla 4.3. That shouldn't have happened.
Because this PR is not working.

avatar sandewt
sandewt - comment - 23 Oct 2022

Removing the if statement makes this PR work. The question is whether that is desirable. See the discussion above.

Change this:

// Show a message when a user is logged out.
if ($app->getIdentity()->guest) {
    $app->enqueueMessage(Text::_('COM_USERS_FRONTEND_LOGOUT_SUCCESS'), 'message');
}

To:

// Show a message when a user is logged out.
$app->enqueueMessage(Text::_('COM_USERS_FRONTEND_LOGOUT_SUCCESS'), 'message');
avatar bembelimen
bembelimen - comment - 23 Oct 2022

Please test #39048

avatar richard67
richard67 - comment - 25 Oct 2022

@sandewt Please test #39048 . Thanks in advance.

avatar sandewt
sandewt - comment - 26 Oct 2022

@richard67

I'd like to do that, but then I'm actually testing my own code proposal. I wonder if that's desirable 😉

avatar obuisard obuisard - change - 30 Nov 2022
The description was changed
avatar obuisard obuisard - edited - 30 Nov 2022

Add a Comment

Login with GitHub to post a comment