1. In ezpublish.yml set your own controller and own template for rendering article ContentType, for e.g:
2. Your controller has to use locationService, for e.g.:
The goal is to use locationService->loadLocation() directly.
3. Template isn't important.
You need 3 separated incognito browser windows or even better, 3 separated browsers.
Browser 1: Editor
Browser 2: Admin
Browser 3: Anonymous
Steps to reproduce:
1. Create new workflow (with a name for e.g: New Workflow): Event / Approve. Set Administrator user as Users who approve content and choose all sections, languages and versions.
2. Configure Workflow trigger: content / publish / before and choose New Workflow.
3. Log in as editor in browser 1. Create a new article (for e.g. Article A) and publish it.
4. In browser 3, as anonymous go to the address: http://ezpublish.dev/Article-A. You should see Module not found message (404).
5. In browser 2 log in as admin. Go to Dashboard -> Collaboration -> select previously created article -> Approve it.
5. After approve, in browser 3, as anonymous go to the address: http://ezpublish.dev/Article-A. You should see Module not found message (404) again.
Run php runcronjobs.php frequent from ezpublish_legacy directory. Run php ezpublish/console ezpublish:legacy:script runcronjobs.php frequent command.
In the console, you should see confirmation, that the article was published.
5. In the browser 3 go to this content directly (type URL manually, don't use breadcrumbs/menu etc.). You should see an article.
6. As editor edit Article A and publish it.
7. As administrator go to Collaboration again, and approve the modified article Article A.
Run php runcronjobs.php frequent from ezpublish_legacy directory again. Run php ezpublish/console ezpublish:legacy:script runcronjobs.php frequent command again.
9. In the browser 3 go to this content directly (type URL manually) as an anonymous user. You should see:
b) incorrect, old (previous, not current) version of the article
The exception is not appearing every time. Sometimes you will see just the previous version of the article.
1. During tests, I noticed that when the issue is going to appear, then article is rendered with default template instead of this one defined in the ezpublish.yml