[5.4][AI] Add shared sessions hint for article preview 404#47394
Closed
Harsh63870 wants to merge 8 commits intojoomla:5.4-devfrom
Closed
[5.4][AI] Add shared sessions hint for article preview 404#47394Harsh63870 wants to merge 8 commits intojoomla:5.4-devfrom
Harsh63870 wants to merge 8 commits intojoomla:5.4-devfrom
Conversation
Contributor
|
It is expected that you test to make sure your submitted code works. |
Contributor
|
Sorry but this is completely wrong. You have not understood the problem |
Member
|
@Harsh63870 It seems this PR here also contains the changes from your other PR #47317 . The reason might be that you based this PR not on the 5.4-dev branch of this repository here but on your other PR‘s branch. Besides this, your PR here is wrong for the reasons stated in previous comments. In this way you only waste time of maintainers. Anyway, thanks for trying. Feel free to propose a new PR if you have learned to handle different branches for different PRs right and to test your changes yourself before proposing PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request resolves #
Resolves #47370.
AI policy checkbox
I read the
Generative AI policy
and my contribution is compatible with the policy and GNU/GPL 2 or later. I used an AI tool to assist with ideas and wording, but I have fully reviewed, adapted, and tested the changes myself and I take responsibility for the contribution.
Summary of Changes
When an article preview is opened from the administrator (in a tmpl=component iframe) and the frontend returns a 404 “Article not found” because the article is not yet published, the error page now checks whether Shared Sessions are disabled.
In that specific case (404 + COM_CONTENT_ERROR_ARTICLE_NOT_FOUND + tmpl=component + shared_session off), the system error template displays an additional hint explaining that Shared Sessions need to be enabled in Global Configuration → System → Session Settings to preview unpublished content from the administrator.
Normal frontend 404 pages for visitors remain unchanged.
Testing Instructions
In Global Configuration → System → Session Settings, set Shared Sessions = No.
In the administrator, create or edit an article and set Start Publishing to a future date/time so it is not yet published on the frontend.
Save the article, then click the Preview toolbar button in the article edit view.
Observe the popup window:
It shows a 404 “Article not found” error (as before).
Under the standard “You may not be able to visit this page because of:” list, there is now an extra hint telling you to enable Shared Sessions and where to configure it.
Optionally:
Turn Shared Sessions = Yes, repeat the preview and confirm that the article preview works normally and the hint is not shown.
Visit a random non-existing URL on the frontend and confirm that the regular 404 page does not show the Shared Sessions hint.
Actual result BEFORE applying this Pull Request
When Shared Sessions are disabled and you preview an article that is not yet published (e.g. Start Publishing in the future), the preview popup shows a generic 404 “Article not found” page with no guidance.
Users are not told that enabling Shared Sessions is required for previewing unpublished content from the administrator.
Expected result AFTER applying this Pull Request
In the article preview popup (tmpl=component), if the request results in a 404 “Article not found” and Shared Sessions are disabled, the 404 page includes an additional message explaining:
That article preview is not available in this situation.
That enabling Shared Sessions in Global Configuration → System → Session Settings will allow the admin login to be shared with the frontend so preview works as expected.
Behaviour for normal frontend visitors and other 404 scenarios is unchanged.
Link to documentations
No documentation changes for guide.joomla.org needed
No documentation changes for manual.joomla.org needed