Search
Other Snippets questions
Forum

Snippet code not executing consistently

Patricia Lawson's Avatar Patricia Lawson
Hello,
I am using Joomla 5.25 with snippets 9.1.6 PRO.

I use snippets to publish our release notes. I have at least 20 releases on the site presently. All work except for the latest one. I published a new release yesterday, but I have several problems with it.

I usually open the previous month's 'master' article - it has the date of the release - and simply Save As Copy. Then I change the name and update the Publish and Create date to the date of the Release. I do the same for any articles that require new relese notes. I did this yesterday, but when I look at the notes on the front end for March 26, 2025 I only see the code for the snippet. I have looked at this from many angles and cannot figure out what is wrong...

More detail:
The snippet code is this:
{articles category="Release Notes" title="!this:id"} {if publish_up = this:publish_up AND !introtext}
[title]
[version-number label="true"]
[text]

[fixed label="true"] [changed label="true"] [added label="true"] [deprecated label="true"] [removed label="true"]
{/if} {/articles}

I have a 'master' article for the release that has the snippet in it and the Title is the release date. The snippet code looks like this: {snippet alias="Release Notes Master Code"}
When I insert the snippet using the snippet button in the editor, I get this code:
{snippet alias="release-notes-master-code"}

however, when I run the second snippet the result is the Title shows, and then the snippet code:
March 26, 2025

{articles category="Release Notes" title="!this:id"} {if publish_up = this:publish_up AND !introtext}
[title]
[version-number label="true"]
[text]

[fixed label="true"] [changed label="true"] [added label="true"] [deprecated label="true"] [removed label="true"]
{/if} {/articles}

When I change the snippet code to {snippet alias="Release Notes Master Code"} I do not get the snippet code, I only see the Title.
However, no associated articles are brought in. I have double checked the articles all have the same category and that the Publish Date is identical to the 'master' article.

(In a different article I use {snippet alias="release-notes-master-code"} - the same as the one the snippet button creates, and this one works. All associated articles are brought in, I don't see code. It is from June 2024...)

I don't know why I am seeing these inconsistencies. I have caching turned OFF for this site, and still clean cache regularly.

For access to my dev site:
Confidential information:
(hidden)


I would appreciate any insights you have. I am supposed to have these release notes out... yesterday...

Pat
Peter van Westen's Avatar Peter van Westen ADMIN
It is probably due to the system plugin ordering. Try changing the ordering of the plugins in question.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Patricia Lawson's Avatar Patricia Lawson
Thanks, Peter. Reordering the system plugins fixed that problem.

The only changes I made to the site before adding new release notes was to update Joomla and to update my Regular Labs extensions. Could either of those have made changes to the ordering of the plugins??

Having 'fixed' the order - my dev site and live have the same order for Reg Labs extensions now - I also use Quick Index to create an index in the right sidebar. My dev system shows the Index content correctly; the live site does not. The have the same code in the custom module called ON THIS PAGE: {index article="current"}

Can you see why these would be different? The Conditions for the modules are identical, too. Attached are images of browser output and Chrome Inspect. Hopefully you can see both images in the folder below...



Thanks
Peter van Westen's Avatar Peter van Westen ADMIN
Try switching on the Prepare Content option in that module.
Please post a rating at the Joomla! Extensions Directory
Patricia Lawson's Avatar Patricia Lawson
It is already on - checked that before.
Patricia Lawson's Avatar Patricia Lawson
Were you able to see the images of the browser output and Chrome Inspect for the ON THIS PAGE module?
Peter van Westen's Avatar Peter van Westen ADMIN
Were you able to see the images
Nope, it isn't a public image

Can you show me where you have the issue?
Do you have this online so I can take a look?
Please post a rating at the Joomla! Extensions Directory
Patricia Lawson's Avatar Patricia Lawson
I have two sites: Dev and Live.
ON THIS PAGE module works on Dev - but as far as I can tell, Dev and Live are identical.

Login Details as follows:
Confidential information:
(hidden)


Thanks
The issue must be something very small....!
Peter van Westen's Avatar Peter van Westen ADMIN
The ordering of your system plugins is completely different on the live site.
I ordered (dragged) Snippets to the top, and Quick Index to near the bottom. All working now.

Please read and watch this again!
See: regularlabs.com/blog/242-plugin-order-is-important

You need to select the ordering column to be able to see the actual order.
Please post a rating at the Joomla! Extensions Directory
Patricia Lawson's Avatar Patricia Lawson
I swear I did that more than once, but yes, I see it now. Sorry to bug you. I knew it had to be something simple - everything else looked ok.
I'll watch the video...

Thanks for your time... and help
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription