Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-02-12 05:01:37

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 177
Website

Unregistered tags after upgrade to v4.8.8

Moderator notice: Topic split from the previous thread as this is a new issue.

——

Me, again!

From euphoria to something else.

The change to the config.php seems to have broken a few plug-ins. Now, when I hit refresh for each web page, multiple errors have kicked in.

Plenty of error messages on every page!

Here’s a sampling from my landing page:

tag error:  <txp:adi_mobile /> ->  Textpattern Notice: adi_mobile tag is not registered while parsing form “None” on page “front-mobile”

textpattern/lib/txplib_publish.php:563 trigger_error()
textpattern/lib/txplib_publish.php:409 processTags()
textpattern/lib/txplib_misc.php:3626 parse()
textpattern/publish.php:740 parse_page()
index.php:74 textpattern()

Tag error:  <txp:adi_if_mobile>

 		<txp:thumbnail id="6043" class="align-center" />

 	<txp:else />

           <script type="text/javascript">
           $(function() { 
           $("#front_showcase").showcase
              ({
               css:       { width: "1080px", height: "500px" },
               animation: { type: "fade", interval: 5000, speed: 1200 },
             <txp:smd_gallery category="landing" 
    delim="@" paramdelim="|" collate="1" limit="4" sort="random"
     combo='sc_img| { url: "{url}", description: "{caption}" }'>
        images: [ {sc_img} ],
</txp:smd_gallery>  

[I chopped out the long CSS part here]

                            });
                         });
                      </script>

 	</txp:adi_if_mobile> ->  Textpattern Notice: adi_if_mobile tag is not registered while parsing form “None” on page “front-mobile”

textpattern/lib/txplib_publish.php:563 trigger_error()
textpattern/lib/txplib_publish.php:409 processTags()
textpattern/lib/txplib_misc.php:3626 parse()
textpattern/publish.php:740 parse_page()
index.php:74 textpattern()

Tag error:  <txp:smd_gallery category="landing" 
    delim="@" paramdelim="|" collate="1" limit="4" sort="random"
     combo='sc_img| { url: "{url}", description: "{caption}" }'>
        images: [ {sc_img} ],
</txp:smd_gallery> ->  Textpattern Notice: smd_gallery tag is not registered while parsing form “None” on page “front-mobile”

textpattern/lib/txplib_publish.php:563 trigger_error()
textpattern/lib/txplib_publish.php:409 processTags()
textpattern/plugins/adi_mobile/adi_mobile.php:366 parse()
adi_if_mobile()
textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func()
textpattern/lib/txplib_publish.php:564 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:409 processTags()
textpattern/lib/txplib_misc.php:3626 parse()
textpattern/publish.php:740 parse_page()
index.php:74 textpattern()

The plug-ins affected are adi_menu, adi_mobile, arc_meta, smd_gallery and maybe some others.

The images seem to work on my webpages, despite the collate in the gallery, but not well on the mobile situation.

These errors seem to remain after I removed the config.php collation addition.

It’s Monday here so despite that I get some hits on the website, I’ll leave it in debugging mode for the next 24 hours so you can see the error messages. Here it is.

I’m not too concerned about having the buggy stuff on show for a while. I’m currently getting around 1200 views a day, but I don’t make money from it, so I’m not losing money.

The adi_menu issue is something I won’t be using for the next 6 months, as it is only applicable when I add a section relating to my trips and I’m recovering from an Achilles tendon tear that takes that long to get back to strength.

I thought I needed adi_menu for something in the menu, but I have just shuffled around section titles and articles to do what I wanted. I will need it in the future.

S’pose I should just revert to my backup in the meantime.

Then again, I do have the time to resolve this now.

Edit: punctuation.

Last edited by detail (2024-02-12 05:05:33)

Offline

#2 2024-02-12 06:58:01

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,708
Website

Re: Unregistered tags after upgrade to v4.8.8

This is a separate issue that has resulted from the Textpattern upgrade, and you should only be seeing those notices when your site is not set to live. It should be unrelated to the textpattern database settings in config.php or adi_menu aspects discussed in the earlier thread. They’re easily resolved and there’s no need to go back to the earlier backup.

From Textpattern 4.8.8 onwards plugins have to register their tags, and your notice indicates you’re using older versions of the plugins. The solution is to upgrade the plugins:

  • Here’s arc_meta (from the GitHub repo)
  • Bloke may have an updated smd_gallery. I can’t reach his site right now.
  • The current version of “adi_menu” I have online should not be showing you those errors as it already registers the tags (here)
  • For adi_mobile, see below…

If there is not an upgraded plugin, you can add a small code snippet to the plugins that registers the public tags. To do this, visit Admin › Plugins and edit the plugin code. At the top, add a snippet listing all the relevant tags according to the following pattern (if the plugin has a section for its admin functions, avoid putting it there):

// Register tags.
Txp::get('\Textpattern\Tag\Registry')
    ->register('abc_tag_name')
    ->register('abc_othertag_name')
    ->register('abc_further tag_name');

For example, here’s the snippet for arc_meta (for info, not needed if you make the upgrade that already contains it).

EDIT: The tag registry section for adi_mobile would be this:

Txp::get('\Textpattern\Tag\Registry')
    ->register('adi_mobile')
    ->register('adi_mobile_script')
    ->register('adi_if_mobile')
    ->register('adi_if_not_mobile')
    ;

TXP Builders – finely-crafted code, design and txp

Offline

#3 2024-02-12 07:33:14

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 177
Website

Re: Unregistered tags after upgrade to v4.8.8

Thanks once again, Jacob.

Hoping it’s another two years before I get the next panic attack.

This should future-proof the websites for a while.

At least until TXP 4.9.

Offline

#4 2024-02-12 08:07:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,430
Website GitHub

Re: Unregistered tags after upgrade to v4.8.8

Ack, sorry. Apache went down on my server. Fixed it.

Don’t think smd_gallery is updated though.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2024-02-12 09:36:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,708
Website

Re: Unregistered tags after upgrade to v4.8.8

Bloke wrote #336598:

Ack, sorry. Apache went down on my server. Fixed it.

Yep, you’re back 🙂

Don’t think smd_gallery is updated though.

You’re right. There’s only one public tag, right? So adding the following after require_plugin('smd_lib'); in the plugin code should resolve the notices:

Txp::get('\Textpattern\Tag\Registry')
    ->register('smd_gallery');

Aside from that, you can now achieve most of what smd_gallery can do (wonderful as it is) using Textpattern’s own image tags.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2024-02-12 10:29:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,430
Website GitHub

Re: Unregistered tags after upgrade to v4.8.8

Yep. Only one tag. And its reliance on smd_lib annoys me so if there’s any way to design the tag out and use core features, please do so.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2024-02-14 03:12:51

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 177
Website

Re: Unregistered tags after upgrade to v4.8.8

Bloke wrote #336600:

if there’s any way to design the tag out and use core features.

I’m not sure how easy that would be.

 <txp:smd_gallery category="landing" delim="@" paramdelim="|" collate="1" limit="4" 
sort="random"  combo='sc_img| { url: "{url}", description: "{caption}" }'>
        images: [ {sc_img} ],
</txp:smd_gallery> 

Your manipulations in smd_gallery still work brilliantly.

Offline

#8 2024-02-14 10:12:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,708
Website

Re: Unregistered tags after upgrade to v4.8.8

detail wrote #336634:

I’m not sure how easy that would be.

<txp:smd_gallery category="landing" delim="” paramdelim=”|” collate=“1” limit=“4”…@

Your manipulations in smd_gallery still work brilliantly.

A first stab, but I’m not sure if this covers it all:

<txp:images category="landing" limit="4" break="," sort="rand()">
    <txp:if_first_image>
        images: [
    </txp:if_first_image>
            {
                url: "<txp:image_url />",
                description: "<txp:image_info />"
            }
    <txp:if_last_image>
        ],
    </txp:if_last_image>
</txp:images>

That should grab 4 images at random that have been assigned to the landing image category and output the required code per image wrapped within the images: [ … ], code.

I’m not sure where the @-delimiter comes in here with this particular situation: perhaps a leftover from another tag on the site, as bringing in articles by image category should create an internal image list independent of separator.

I did read somewhere else that you have used the _@_-sign in your article_image field as a separator, and somewhere else again that you have a combination of comma and @-separators for defining a title image and a gallery using upm_article_image. Is that still correct? That should be convertible with regular tags too. Oleg introduced a way to process a string as a list according to different parameters, but I need to search for that on the forum. If you are using the comma separator up front, and then the at-separator for the remaining items, one could split the article_image field first into two variables, one for the title image, the other for the gallery…

EDIT: continuing this train of thought having found Oleg’s post:

If your article_image field just looks like this:

1234 @ 2345 @ 3456 @ 4567 @ 5678 @ 6789

Then you can use this for the txp:images tag:

<txp:images id='<txp:custom_field name="article_image" breakby="@" break="," trim />' break=",">
   … the rest as before …
</txp:images>

That should convert the at-separator into a comma-separated list for the id attribute of the txp:images tag.

If, on the other hand, your article_image field looks like this:

9876, 1234 @ 2345 @ 3456 @ 4567 @ 5678 @ 6789

then I would split this into two parts first.

<!-- get and store first part before comma -->
<txp:variable name="title_image_id"><txp:custom_field name="article_image" breakby="," limit="1" /></txp:variable>
<!-- get and store second part after comma -->
<txp:variable name="gallery_image_ids"><txp:custom_field name="article_image" breakby="," limit="1" offset="1" /></txp:variable>
<!-- convert from at-separated list to comma-separated list -->
<txp:variable name="gallery_image_ids"><txp:variable name="gallery_image_ids" breakby="@" break="," trim /></txp:variable>

and then use these variables where you need to output your image and your gallery, e.g.:

<!-- your title image -->
<txp:image id='<txp:variable name="title_image_id />' />

<!-- your gallery -->
<txp:images id='<txp:variable name="gallery_image_ids" />' break=",">
   … the rest as before …
</txp:images>

This is untested and you may need to adapt to your specific situation. If you are using the comma and at-separator combination to create an either/or situation, e.g. either the title image at the top and gallery later OR when no title image is available show the gallery at the top, you can use if_variable to control how to respond.

EDIT #2: Have since seen that Oleg already showed you this principle in his answer to a similar situation over here


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB