Page 1 of 1

categorytemplates version 0.25 issue

Posted: Mon Jan 21, 2008 3:00 am
by bdconnolly
Tried to upgrade to ver 25 and I'm having a slight problem.

This generates page with proper category:

http://strumpette.com/categories/15-News-and-Commentary

However, single article generated page using default blog category:

http://strumpette.com/archives/652-Edel ... ation.html

I downgraded back to ver .23. Single article again uses its assigned category template.

Thoughts?

Posted: Mon Jan 21, 2008 7:52 pm
by bdconnolly
Judebert, Don? Hello?

Posted: Tue Jan 22, 2008 4:20 pm
by judebert
Hello! Sorry to be so late; I usually spend the weekends and holidays interacting with my family. (I'm so selfish.)

I was afraid this would happen. Version 0.25 includes the new code for assigning a priority to the custom template categories. If an entry has more than one category with a custom template, you can now specify which one is displayed.

However, the priority ordering is done by a new widget: the sequence widget. To install that widget, you currently must install the serendipity_event_advtypes plugin, known to SPARTACUS as Advanced Configuration Types.

Once it's installed, you can visit the categorytemplates plugin configuration, and a list of all your custom categories will appear at the bottom. You can use drag-and-drop to order them in the priority you like, just like plugins. Then save, and everything will work as expected... only faster. And better.

Unfortunately, if you haven't got the advtypes plugin installed, you might come up with this problem. I thought I had everything set up so that you could just visit the categorytemplates plugin configuration page, hit save, and expect everything to work. But I might be mistaken; I couldn't test for that particular problem. (Garvin, is there a way to execute some code on installation or upgrade, without hitting the database every time?)

If you've got the time, please reinstall 0.25, visit your categorytemplates plugin config, verify that it doesn't have categories listed on the bottom, and save. Then let me know if it fixes the problem. If it doesn't, I'll work on a fix for others; you can just install the new advtypes plugin, configure your custom templates priorities, and watch it work (which I actually did test, reasonably thoroughly).

Sorry for the inconvenience.

Posted: Tue Jan 22, 2008 4:23 pm
by garvinhicking
Hi Judebert!

There's no automatic update check routine, but a plugin can check if a certain config-variable is set. If not, it executes its code, sets this variable, and it's never queried again. Plugins like freetag or staticpage use that intensely to upgrade the database.

HOWEVER, I believe there should be a way to use the categorytemplate plugin without the sequencing widget. When a sequence-config variable is not defined, the plugin should (IMHO) put the preference so like the version 0.24 of the plugin: Simply use the first defined template of a special category, if multiple templates are assigned.

(I also posted in the other thread in "Development" with some code questions. Sadly I won'T have the time before saturday to test actual code)

Regards,
Garvin

Posted: Tue Jan 22, 2008 4:37 pm
by judebert
I understand. I actually added the stuff to the "default" of the sequence widget, figuring it would get set; I'll do some patching a little later.

Posted: Tue Jan 22, 2008 5:38 pm
by judebert
Errr... no, I didn't add it to the default. That's the question on the developer's thread. I think adding a default order might fix the problem.

Posted: Wed Jan 23, 2008 12:25 am
by judebert
And I'm wrong. (Sorry for hijacking the whole thread.)

However, I did fix the issue in 0.26, which I just committed. It should be available within 24 hours, maybe sooner.

Version 0.26 checks to see if the categories have been prioritized with the sequence widget. If not, it uses alphabetical order, just like the <=0.24 plugin did.

This time, I managed to do a lot more in-depth testing. It should be much more robust now.

Again, I apologize for the inconvenience.