categorytemplates version 0.25 issue

Creating and modifying plugins.
Post Reply
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

categorytemplates version 0.25 issue

Post 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?
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post by bdconnolly »

Judebert, Don? Hello?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
Post Reply