Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#316 2020-01-04 17:51:27
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
jakob wrote #320817:
Adi, best of luck that you are spared the horrors that many of your compatriots are experiencing at the moment 🙏.
Adi – stay safe.
…. texted postive
Offline
#317 2020-01-12 20:52:48
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Adi
Man, I know how bushfire prone the Great Ocean Road area is. Just hope you get some rain through to dampen things down. Seems that’s the only way it will escape.
gomedia wrote #320812:
Yep, your summation is correct – the sort value is maxed out at 255. Not sure why I picked that limit – it makes the fix a bit awkward (the db column size will need to change, amongst other things).
I believe something happened with the drag and drop function that has left a gap between sort value 62 and 255.
You will note that something has happened with the 62 entry in the menu list, that now lies outside the <ul>. 61 is the last one in the correct order. But maybe that is a final sort.
That last line below does not seem to be correctly formatted code. One of the reasons or consequences of this issue is that I am unable to drag and drop any items in the menu list.
This is the code that is messed up, taken verbatim from “view source” in my browser.
<li id=“larapinta-blog”><a href=“https://tramping.net.nz/larapinta-blog/”>Larapinta Trail, central Australia blog | April 2012</a><input type=“hidden” value=“61” class=“sort_value” name=“sort[larapinta-blog]”></li> <li id=“arahura-blog”><a href=“https://tramping.net.nz/arahura-blog/”>Arahura/Styx blog | December 2019</a><input type=“hidden” value=“255” class=“sort_value” name=“sort[arahura-blog]”></li> <li id=“cascade-blog”><a href=“https://tramping.net.nz/cascade-blog/”>South Westland to Queenstown blog | January/February 2019</a><input type=“hidden” value=“255” class=“sort_value” name=“sort[cascade-blog]”></li> <li id=“nlnp-2018”><a href=“https://tramping.net.nz/nlnp-2018/”>Nelson Lakes blog | December 2018</a><input type=“hidden” value=“255” class=“sort_value” name=“sort[nlnp-2018]”></li>
<li id=“angelus-blog”><a href=“https://tramping.net.nz/angelus-blog/”>Lake Angelus blog | July 2019</a><input type=“hidden” value=“255” class=“sort_value” name=“sort[angelus-blog]”></li> </ul> <input type=“hidden” value=“62” class=“sort_value” name=“sort[blog]”></li>
For some reason the plugin is not assigning a correct sort value to those last four, most recent, menu items. They should be at the top of the list. I am unable to drag them into the correct order. They aren’t even in the order I added them.
I’m just wondering if I need to just reinstall the plugin. Or somehow otherwise get the correct sort value assigned.
This is the code for the navigation, but any issue here doesn’t explain the lack of drag and drop.:
<!— navigation blogs—>
<nav role=“navigation”> <txp:adi_menu menu_id=”“ class=“menu” active_class=“current” current_children_only=“1” parent_class=”“ sort=“adi_menu_sort” articles=“1” active_articles_only=“1” article_attr=‘sort=“posted asc” status=“live”’ /> </nav>
Or maybe something has changed with the serving software.
Textpattern version: 4.7.1
PHP version: 5.6.27
jquery: 1.11.2
And now I too am taking off for the hills.
Thanks for this plugin and assistance.
Offline
#318 2020-01-29 03:53:58
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
detail wrote #321052:
Thanks for this plugin and assistance.
Just a note for anyone following this thread. This has been easily resolved, at least on my part, by Adi updating a beta version I was using to deal with 4.7 changes.
This is an extremely powerful plug-in, the ability to create numerous sub-sections, and change around the names and order of anything on a website’s menu.
That is useful when dealing with any textpattern website that has the need for many different sections, and sub-sections. This website I’ve been resolving has almost 1200 pages currently, with 14 main sections, with one of those sections having 39 sub-sections! Each sub-section has up to 85 individual articles.
So, adi_menu is a beast!
Thanks for all your work Adi!
Offline
#319 2020-01-29 10:01:20
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thanks for everyone’s best wishes. We moved from the Great Ocean Road in Victoria – which was meant to be the most riskiest for bushfires – to supposedly safe-ish NSW. The irony! It got a bit hairy at one point but currently we’re alright. About 60% of our shire is burnt out. Fire season is not yet over unfortunately.
For the record, adi_menu-1.4beta13 is the latest version that copes with newer TXP releases.
Offline
#320 2020-12-08 09:25:02
- Bruce Bowden
- Member
- From: Melbourne, Australia
- Registered: 2020-10-22
- Posts: 28
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
I have used adi_menu on my first project. Worked perfectly and did exactly what I wanted.
Project no 2 is not so good. The only change is going from Textpattern 4.8.3 to 4.8.4.
Installing adi_menu v1.4beta13 on a clean install with only a couple of sections added gives the following errors when you try to go to Presentation-> menu:
First:
User_Error “Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation ‘=’”.
Then:
Warning “mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given”.
I might have to switch back to 4.8.3.
It’s running on a Raspberry Pi, not sure what software versions but everything is new this year.
(The Raspberry Pi and Textpattern have been my Melbourne lockdown projects.)
Thanks
Bruce
Offline
#321 2020-12-08 09:45:07
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Hmmm, quite why this would change between versions when there’s nothing we’re doing between 4.8.3 and 4.8.4 in terms of collation is mystifying. Maybe there’s something different in the server setup or the config.php collation this time around?
Failing that, from your favourite MySQL client, take a look at the connection and database collations:
show session variables like '%collation%';
show variables like "collation_database";
and the tables or columns of various tables:
show table status;
show full columns from adi_menu;
If you have a different collation on the adi_menu table or some of its columns compared with (say) your txp_section table then that might account for the issue.
Short of hacking the plugin to use a collation-independent comparison (such as BINARY or forcing a specific COLLATE method), can you manually alter the offending tables so the collations match?
ALTER DATABASE yourdb DEFAULT COLLATE utf8mb4_general_ci;
ALTER TABLE some_table CONVERT TO CHARACTER SET utf8 COLLATE utf8mb4_general_ci;
Or something along those lines? Backup first, of course :)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#322 2020-12-08 10:19:11
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Bruce Bowden wrote #327350:
(The Raspberry Pi and Textpattern have been my Melbourne lockdown projects.)
I’d like to hear more about this. Would you be prepared to start a new thread and tell us the processes you used for that?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#323 2020-12-08 20:35:50
- Bruce Bowden
- Member
- From: Melbourne, Australia
- Registered: 2020-10-22
- Posts: 28
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Ok,
Nothing like posting on the forum to make you focus on the problem.
It turns out that I never had adi_menu running on the Raspberry Pi. That was added to the site after I moved the site to the “live” server.
4.8.4 is not the problem as a fresh install of 4.8.3 on the Pi shows the same errors.
So my problem really is: adi_menu runs on the live server but not on the Pi.
I will spend today using Stef’s suggestions to explore the set up on the Pi. I’ll report back with any results.
Stay safe
Bruce
Offline
#324 2020-12-08 20:38:57
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Bloke wrote #327351:
Hmmm, quite why this would change between versions when there’s nothing we’re doing between 4.8.3 and 4.8.4 in terms of collation is mystifying. Maybe there’s something different in the server setup or the config.php collation this time around?
Thanks Stef. Have been thinking about this overnight and my gut feeling comment was going to be the same.
There’s a whole raft of information on stackoverflow but my brain started to melt … there’s a comment in there to the effect of “setting all tables to the same collation may not fix it”. Argh!
I’ve been wondering for years whether this issue might raise it’s ugly head one day. On my local installations standard TXP tables are created with collation utf8_general_ci but plugin tables end up with latin1_swedish_ci. I’ve got:
SHOW session variables like '%collation%';
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | utf8_general_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+-------------------+
And because I backup/restore databases onto live hostings, the remote databases are the same. Never been a problem!
Does anyone know if there’s a right or wrong collation setup? Or even whether it’s worth worrying about if things are working?
Offline
#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,373
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
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.
Hire 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
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