Skip to content

[5.4][AI] Add shared sessions hint for article preview 404#47394

Closed
Harsh63870 wants to merge 8 commits intojoomla:5.4-devfrom
Harsh63870:fix-47370-frontend-link
Closed

[5.4][AI] Add shared sessions hint for article preview 404#47394
Harsh63870 wants to merge 8 commits intojoomla:5.4-devfrom
Harsh63870:fix-47370-frontend-link

Conversation

@Harsh63870
Copy link

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

@brianteeman
Copy link
Contributor

It is expected that you test to make sure your submitted code works.

@brianteeman
Copy link
Contributor

Sorry but this is completely wrong. You have not understood the problem

@richard67
Copy link
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.
Another reason could be that you are not familiar with Git or with your IDE.

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.

@richard67 richard67 closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Frontend Link" module 404 error

4 participants