Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#457 2020-04-05 15:43:54

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

Re: smd_tags: unlimited article, image, file and link taxonomy

Another minor report. I get the following error when deleting a tag that is already assigned to an article via the “Manage Tags” pane:

User_Error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1"
in /Users/me/Sites/site_name/textpattern/lib/txplib_db.php at line 450.

The error doesn’t occur as far as I can tell when deleting an unused tag.


TXP Builders – finely-crafted code, design and txp

Offline

#458 2020-04-07 21:18:42

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

Hi. I got the same. Works only with messy links and it is a new installation with no other plugins besides smd_tags

jakob wrote #322488:

Also for the record with 0.7.0, the links generated by the plugin:

www.domain.com/triggersection/tagname -> 404
www.domain.com/triggersection/article/tagname -> 404

but messy links work:

www.domain.com/triggersection/?smd_tag=tagname -> works
www.domain.com/triggersection/?smd_tag_type=article&smd_tag=tagname -> works

where the trigger section is set up in txp and has no articles of its own.

Offline

#459 2020-04-08 06:50:26

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

Re: smd_tags: unlimited article, image, file and link taxonomy

robhert wrote #322544:

Hi. I got the same. Works only with messy links and it is a new installation with no other plugins besides smd_tags

Hi robhert, my ‘for the moment’ temporary solution for this was to add the following line to the .htaccess file before the first RewriteCond … REQUEST FILENAME line:

# Temporary: smd_tags theme rewrite
RewriteRule ^triggersection/(article/)?(.+)$ index.php?s=triggersectiond&smd_tag=$1

replacing triggersection (in the first ‘from’ part and the second ‘to’ part) with the section you designated as the trigger word in your smd_tags settings.

That catches the 404 article tag links and redirects them invisibly to your target page.


TXP Builders – finely-crafted code, design and txp

Offline

#460 2020-04-08 19:05:43

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

Hi Jakob! It works!

Just deleted the last “d” in the second triggersection (was triggersectiond)

# Temporary: smd_tags theme rewrite
RewriteRule ^triggersection/(article/)?(.+)$ index.php?s=triggersection&smd_tag=$1

In my case is:

@RewriteRule ^etiqueta/(article/)?(.+)$ index.php?s=etiqueta&smd_tag=$1

Thank you Stef and Jakob!

jakob wrote #322547:

Hi robhert, my ‘for the moment’ temporary solution for this was to add the following line to the .htaccess file before the first RewriteCond … REQUEST FILENAME line:

# Temporary: smd_tags theme rewrite...

replacing triggersection (in the first ‘from’ part and the second ‘to’ part) with the section you designated as the trigger word in your smd_tags settings.

That catches the 404 article tag links and redirects them invisibly to your target page.

jakob wrote #322547:

Hi robhert, my ‘for the moment’ temporary solution for this was to add the following line to the .htaccess file before the first RewriteCond … REQUEST FILENAME line:

# Temporary: smd_tags theme rewrite...

replacing triggersection (in the first ‘from’ part and the second ‘to’ part) with the section you designated as the trigger word in your smd_tags settings.

That catches the 404 article tag links and redirects them invisibly to your target page.

p.

Offline

#461 2020-04-09 00:42:13

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

Re: smd_tags: unlimited article, image, file and link taxonomy

Good workaround with the .htaccess. That’s genius.

Weird, though. The plugin works without that hack in my tests under both 4.8.0 and 4.8.1-dev.

*scratches stubble*

EDIT: wait, you have altered your smd_tags plugin load order to be lower than 5, right? For reasons I have yet to ascertain, it doesn’t work if it’s 5 or higher.

Last edited by Bloke (2020-04-09 00:43:40)


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

#462 2020-04-09 09:15:21

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

Re: smd_tags: unlimited article, image, file and link taxonomy

@jakob. I think I’ve fixed the PHP 7.4.2 warning. I don’t have an environment with it installed, but this commit should improve things. Please test.

I’ll work on the admin-side issue you raised later, as I have a slew of corner case bugs to squish on the tag management panel.


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

#463 2020-04-09 10:25:51

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

Re: smd_tags: unlimited article, image, file and link taxonomy

Bloke wrote #322556:

@jakob. I think I’ve fixed the PHP 7.4.2 warning. I don’t have an environment with it installed, but this commit should improve things. Please test.

Yes, that seems to have resolved the notice with PHP 7.4.2. Thanks!!

Bloke wrote #322555:

wait, you have altered your smd_tags plugin load order to be lower than 5, right? For reasons I have yet to ascertain, it doesn’t work if it’s 5 or higher.

I didn’t know about that. I set the load_order in the database to 4 (and then later 1) and commented out the line in .htaccess but no luck. I even get a 404 for the trigger section (which is set up under Admin › Sections in txp), which I don’t get with the load order set to 5.

Is there anything I can do to help you?

Good workaround with the .htaccess. That’s genius.

It’s a bit simple. Really it should also deal with tags for images, links, etc.


TXP Builders – finely-crafted code, design and txp

Offline

#464 2020-04-09 10:52:41

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

Re: smd_tags: unlimited article, image, file and link taxonomy

Huh, that’s totally bizarre. I have a stock 4.8.0 set up on MAMP, just the bleeding edge plugin code installed, with load order 4 (I neglected to mention that stipulation in the announcement post, oops, sorry).

I made two tag trees with a handful of tags in each, assigned randomly to a set of 6 articles. I’ve changed the tag landing page to just tags and made that a Section with a dedicated Page containing this code within its other HTML furniture:

<smd::if_tag_list>
    <smd::tag_list wraptag="div" break="br">
        <smd::tag_info item="indent" />
        <smd::tag_name link="1" title="1" wraptag="span" />
        (<smd::tag_info item="count" />)
        <smd::related_tags type="article" section="articles" wraptag="ul" break="li" />
    </smd::tag_list>
<smd::else />
    <smd::tag_list showall>
       <smd::tag_name link /> <smd::tag_count />
    </smd::tag_list>
</smd::if_tag_list>

In my default Form, I added this to display the assigned tags:

<smd::if_tag>
   <smd::tag_list>
      <smd::tag_name link /> <smd::tag_count />
   </smd::tag_list>
</smd::if_tag>

That’s it. I can navigate the tags, view the tag tree. And if I strip off the tag from the URL (or click the Tags section from the menu bar) I can see the entire clickable list of tags.

I haven’t messed with any of the permlink settings per section yet, so maybe if I do that it’ll start breaking. That’s next on the hit list.

Somewhere there has to be a reason why this is breaking on more established sites, because the above doesn’t work on a site I’ve had around for ages.

Do you have the luxury of being able to set up a vanilla install and at least verifying it does work as above in this environment? If not, there’s something else at play. If it does, well, we can then tinker with settings and stuff one thing at a time until it breaks and that might lead us to the answer.

Thank you, and sorry for the continued hassle this plugin is causing.


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

#465 2020-04-09 13:37:27

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

Re: smd_tags: unlimited article, image, file and link taxonomy

Right, I did that and – with the load_order set to 4 – it does indeed work :-)

If it helps you, would it be useful to you to output certain variables from the respective txp sites in order to compare?


TXP Builders – finely-crafted code, design and txp

Offline

#466 2020-04-09 13:41:04

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

Re: smd_tags: unlimited article, image, file and link taxonomy

Phew. So I’m not going entirely mad, thank you for the verification!

Anything you can output that might indicate a difference between the environments – URL schemes, Txp variables, structural differences – would be a massive help. There has to be something going on and it’s probably really simple. It’s doing my head in :-|


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

#467 2020-04-09 20:57:26

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

Re: smd_tags: unlimited article, image, file and link taxonomy

After exporting as csv, sorting and diffing some of the tables of the working and non-working sites I think I might have found a possible reason.

The non-working site has two sections set to /title only URL scheme (“impressum” and “suche”). It seems that was throwing it out. Switching them back to /section/title (or rather “Default”) and it works again!

I tried adding a “colophon” section with just /title url scheme to the fresh working installation, and indeed, you get a 404 for all the tags pages. I’m not sure if the others had a similar setup but maybe that helps locate the problem??

EDIT: Just tried out all the other url schemes. It seems /title is the only culprit.


TXP Builders – finely-crafted code, design and txp

Offline

#468 2020-04-09 21:21:41

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

Re: smd_tags: unlimited article, image, file and link taxonomy

jakob wrote #322565:

The non-working site has two sections set to /title only URL scheme (“impressum” and “suche”). It seems that was throwing it out. Switching them back to /section/title (or rather “Default”) and it works again! … Just tried out all the other url schemes. It seems /title is the only culprit.

Excellent sleuthing, thank you. That may indeed lead me to finding a solution. I shall run some tests and see if anything can be done about that.

Interestingly, on my dev site, I don’t have any section set to /title but I still get a 404 on any tag page, so maybe there’s something else at play in addition to what you’ve found. I’m hoping that maybe if I find the problem with the particular URL scheme you highlighted, the penny might drop and let me figure out what else is falling apart.


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

Board footer

Powered by FluxBB