Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#325 2020-12-10 04:57:37

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

adi_menu is now playing nicely for me. Many MariaDB searches and even more typos later, I successfully converted the collation of my adi_menu table from utf8mb4_general_ci to utf8mb4_unicode_ci to match all the other tables in the database.

Another live site shows a great mixture of collations amongst the tables but its all working so I am not touching it!

Offline

#326 2020-12-10 07:10:20

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,303
Website

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Bruce Bowden wrote #327393:

adi_menu is now playing nicely for me. Many MariaDB searches and even more typos later, I successfully converted the collation of my adi_menu table from utf8mb4_general_ci to utf8mb4_unicode_ci to match all the other tables in the database.

Another live site shows a great mixture of collations amongst the tables but its all working so I am not touching it!

Well done … these things are sent to try us! I’m sure this issue will come back to bite us again.

Offline

#327 2020-12-10 10:05:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,090
Website

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

gomedia wrote #327368:

Does anyone know if there’s a right or wrong collation setup? Or even whether it’s worth worrying about if things are working?

Alas, it’s not my area of expertise either. I cobbled together the response to Bruce from that Stackoverflow post you cited, plus a few pickings from my experience the last time it happened to me. I had the same thing with a plugin of mine (I forget which) and I had to remove the collation on the plugin’s install/upgrade script to let the system decide in future. Or something.

Quite why when you install Txp you get one collation, and when you install a plugin you sometimes get another is not something I’ve ever discovered. I did wonder if it’s to do with it defaulting to the one used by the connection, but in theory the connection collation is identical at Txp install as it is when installing plugins. So it can’t be that… uhh, I don’t think. *shrug*

Most of the time the mix of collations isn’t an issue, as MySQL figures it out and applies the right conversion automatically. It’s only when two collations have the same ‘internal weighting’ that MySQL throws its arms up.

Since errors depend on the type of operation being performed by the plugin and the actual collations in use in the database, it’s not something that plugin authors can always consciously control; nor even find out unless they try all manner of obscure collation combos during the testing phase.

Ain’t nobody got time for that.


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

#328 2020-12-10 19:59:07

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

It was Stef’s code that solved my problems.

It does look like this is a pretty rare event. Different collation could happen if you start building the site on one server, then continue on another. But they also seem to differ even when everything is constant. Should we be specifying moon phases as part of the installation process?

Stay safe
Bruce

Offline

#329 2020-12-28 13:30:59

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Hi,

I have rather a large number of sections (60+) and after adding two new ones I got this error when accessing adi_menu: ‘fatal error: allowed memory size of 134217728 bytes exhausted’. I deleted two now unused sections and it worked again.
Is there a way to change the allocated memory? The error suggested to edit a file in the textpattern folder.

best,

Kees

Offline

#330 2021-01-02 23:19:47

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Hi Kees,
I just hit the same bug but with many fewer sections. Boosting the PHP memory allocation didn’t fix the error But..

My new sections had numeric names: 2020, 2021, etc. Changing the names to 2020events fixed the problem. I was able to leave the title as 2020 so the change won’t impact the final appearance of the site.

Hope this helps.

stay safe
Bruce

Offline

#331 2021-01-04 00:53:31

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,303
Website

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

kees-b wrote #327879:

I have rather a large number of sections (60+) and after adding two new ones I got this error when accessing adi_menu: ‘fatal error: allowed memory size of 134217728 bytes exhausted’.

Hmm … a couple of possibilities spring to mind, but then again they don’t really make sense:

  1. adi_menu does use recursion and could be disappearing into a loop … but I’m sure I put some code in to prevent it.
  2. arrays are used for internal storage, but I can’t believe that 128MB is being chewed up for only 60 sections

Do you see the error on the admin or public side? May be worth checking there’re no loops – e.g. child1 belongs to parent1 which belongs to grandparent1, grandparent1 belongs to child1. What’re your TXP/adi_menu versions?

Bruce Bowden wrote #327979:

I just hit the same bug but with many fewer sections. Boosting the PHP memory allocation didn’t fix the error But..

My new sections had numeric names: 2020, 2021, etc. Changing the names to 2020events fixed the problem. I was able to leave the title as 2020 so the change won’t impact the final appearance of the site.

Interesting …! Leave it with me, but could you confirm the TXP & adi_menu versions, thanks.

Offline

#332 2021-01-04 02:16:08

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

TXP version 4.8.4 and adi_menu version 1.4beta13

Offline

#333 2021-01-05 09:34:55

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,303
Website

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Hi kees-b & Bruce Bowden.

Very interesting indeed! Took me a little while to work out what was going on but thanks to the numerical section name clue (thanks Bruce) I was able to nail it … hopefully.

Try this one & let me know how you get on.

Offline

#334 2021-01-05 20:33:45

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Hi Adi,
That works for me. No problems anymore with numeric section titles.

Thank you for the quick response.

Stay safe
Bruce

Offline

#335 2021-01-06 05:55:01

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,303
Website

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Bruce Bowden wrote #328058:

That works for me. No problems anymore with numeric section titles.

Great … and to draw a line under this long drawn out string of betas here’s the official 1.4 release.

If you’ve been a previous 1.4beta user, visit the adi_menu admin tab immediately after installing 1.4 in order to automatically run an upgrade process.

There’s a raft of updates to the plugin which I’ve listed in the initial post on this thread.

Please note that although it hasn’t been updated fully for TXP 4.7+, it will still be fully functional – albeit with a couple of untranslated language strings in the admin tab. It’s on my to-do list … honest.

Last edited by gomedia (2021-01-08 01:21:37)

Offline

Board footer

Powered by FluxBB