Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-11-15 17:26:43

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re-Install Question....

I am not sure of how to install TXP 4.2.0 from scratch and then restore or import an old installation in this particular instance:

I think I need to do this because, when I upgraded a site from 4.0.8 to 4.2.0 a while back, the wow_menu plugin stopped working and started displaying errors in the wow_menu Menu Control extension tab after I click “save changes”. I know that wow_menu works fine in a fresh installation of 4.2.0 because I installed it from scratch in a different directory (with a new mySQL database on the same server). So, I have to assume that something in the upgrade from 4.0.8 did something to “break” how the plugin works.

I am not sure how to go about trying to install TXP from scratch and then import the old data. Can I run the setup process and just point the new installation to the old database? If I do this, I imagine it might just lead to the same errors… because it will be the same database. The other option I can think of is to copy all of the pages, forms, articles, etc. by hand and recreate the site. I would love to avoid that painstaking process. Any suggestions/advice? Thanks!

Note: I already tried deleting the plugin and I dropped the idx field that the plugin created in the txp_category table. Then I reinstalled the plugin from scratch. The same errors occur. An example of the error message:

Warning: 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 update txp_category set idx = 0 where id = in /home/account/public_html/textpattern/lib/txplib_db.php on line 85

Offline

#2 2009-11-15 22:16:30

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: Re-Install Question....

FYI: If anyone is curious. After spending all day experimenting with different databases and import/export options, I figured out that the problem with wow_menu and 4.2.0 is directly related to using the remora template for the admin area. I switched back to the classic template and the plugin works again (and the errors are gone from the Menu Control tab).

Offline

#3 2009-11-15 23:07:39

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Re-Install Question....

Better to update the old installation to TXP 4.2.0 first so that the mySQL database structure is updated before you try to import it into a fresh 4.2.0 installation.

Offline

#4 2009-11-15 23:28:38

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: Re-Install Question....

thanks Joe – yep, I did upgrade the site to 4.2.0 prior to attempting to import into a fresh installation. I finally figured out that the issue doesn’t have to do with an upgrade at all, it has something to do with the “remora” admin template interacting with the wow_menu plugin. I’m not sure why this is a problem, but when I switched back to the “classic” template in admin > advanced preferences, the plugin started working again and the errors stopped displaying in the Menu Control extension tab. (this was tested on a fresh installation of 4.2.0 and on the original site that was upgraded to 4.2.0)

wow_menu is orphaned, so no one is around to actually alter the code to work with the new “remora” admin template. I would try, but my programming knowledge is limited. The good thing is that the plugin does work if the classic admin template is used.

Offline

#5 2009-11-16 13:11:18

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Re-Install Question....

Hello again, just as a general point, it’s fair to suggest that the need for navigation plug-ins like wow_menu is greatly diminished since the advent of txp tags in txp tags. TXP Tips is replete with excellent native TXP routines that can be used to generate both category and section based navigation. If, for instance, using ‘Remora’ is important then it is likely that you could find a routine that you could use straight out of the TXP Tips article or adapt slightly to make your Categories based menu.

Offline

#6 2009-11-16 16:01:10

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: Re-Install Question....

I agree – however, in this instance, the problem I can’t seem to solve with txp tags is custom category order. wow_menu adds the idx field to the txp_category table and then allows me to easily set the sort the order of the categories in the Menu Control extension tab. Everything is perfect with txp:category_list except for the inability to sort by this custom order.

Do you know if there is a way to use the sort attribute of the txp:category_list tag to sort by the idx field? The only way I can think of would involve using another plugin (smd_query). Jsoo helped show me how to use smd_query in the sort attribute for an article_custom tag. However, with my limited knowledge of MySQL, I am not sure of how to edit his solution so that it will work to sort a txp:category_list by idx. Even though this would require me to use yet another plugin, I would prefer to use txp:category_list (with smd_query) than use wow_menu for the output of the categories (wow_menu adds a bunch of annoying classes and ids and divs to the output that I’d rather not deal with).

Offline

#7 2009-11-16 16:39:47

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

Re: Re-Install Question....

The problem with wow_menu is it does not confine its javascript to its own content block. The javascript does this:

document.getElementsByTagName("li")

which fetches every ‘li’ element from the entire page and iterates over them. In Remora (and countless other themes, including those of thebombsite), the TXP menu header is not a table and is rendered as a series of UL/LI tags. You can see where that could make the plugin tip over.

So what needs to happen in the plugin (in fact, what it should have been doing all along) is it needs to limit its view to its own list. That means only counting and working on the descendent elements of its own menutree div, not the whole DOM.

Updating the plugin to use jQuery might be simpler than trying to hack the old-skool DOM scripting to use descendents. I had a go for 10 minutes and gave up because my jQuery is not that good and I couldn’t immediately figure out how wow_menu packages up the menu_order string. Someone with more time / inclination / better coding could whip up a fix in a jiffy.

EDIT: smd_query? You’ll need someone who knows how to use it then… ;-)

Last edited by Bloke (2009-11-16 16:43:58)


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

#8 2009-11-16 18:23:04

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: Re-Install Question....

ooh, thanks Bloke. You have helped me to understand why wow_menu gets confused in Remora. I am just going to stick with Classic for now. But it would be cool if a jQuery expert wanted to adopt/revamp wow_menu … so many possibilities…

I waited to reply until I’d thoroughly tried my best to figure out how to write the txp:category_list sort statement with smd_query. I think I’ve got it — but it would be nice if someone who knows how to use it would check my work ;-)
(just to make sure I’m not doing something that will end up breaking my database)

<txp:category_list parent="projects" exclude="projects" sort='field(id, <txp:smd_query query="SELECT txp_category.id FROM txp_category ORDER BY idx" break=",">{id}</txp:smd_query>)' wraptag="ul" break="li" class="sub" active_class="current" title="1" />

Offline

Board footer

Powered by FluxBB