Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here's the begining of an update. The big change is that it swaps the - for _ in the node names.
Comment | File | Size | Author |
---|---|---|---|
#29 | category_update_drupal5_3.patch | 194.84 KB | Jaza |
#27 | category_update_drupal5_2.patch | 194.73 KB | Jaza |
#26 | category_update_drupal5_1.patch | 194.36 KB | Jaza |
#20 | category_update_drupal5_0.patch | 190.95 KB | Jaza |
#19 | category_update_drupal5.patch | 154.91 KB | Jaza |
Comments
Comment #1
drewish CreditAttribution: drewish commentedforms now use pull model.
Comment #2
drewish CreditAttribution: drewish commentedadded dependencies .info files
Comment #3
DayShallCome CreditAttribution: DayShallCome commentedIs there a plan to switch CVS to 5.0 in the near future? Or is that a far way off?
Comment #4
Jaza CreditAttribution: Jaza commented@DayShallCome: 5.0 upgrade is not that far off. At the moment, the main thing that needs to be done before the upgrade is the tying up of a few more bugs. Also, some of the modules in the
/contrib
directory cannot be upgraded until their dependent external modules (i.e. views, pathauto) are upgraded to 5.0. And it would be a help to category if CCK was upgraded to 5.0 soon (although strictly speaking, category is not dependent on CCK).Comment #5
drewish CreditAttribution: drewish commenteduh, are you speaking about Drupal in general or just about your module? CCK has been 5.0 compatible for a while. sure there are still some bugs but it works... category on the other hand could be ready to go.
Comment #6
bdragon CreditAttribution: bdragon commentedWorking on bringing this up to date again. This is a work in progress.
Made a start at 5.0izing the menu. There's more arg() to check though. (I double checked category.module, but I still need to check other arg().
Also added hook_simpletest in prepration for having proper testing. (Mainly because I didn't bother to take it back out before rolling the patch.
Only category.module is tested, things are likely broken due to the menu changes.
I also envision a problem with directly querying $node->type (The content-types-in-core stuff, to be exact...)
Comment #7
bdragon CreditAttribution: bdragon commentedNow that I think of it, just plain ripping out hardcoded category_cat and category_cont and converting to content-types-in-core would make things a bit simpler and cleaner.
Comment #8
Jaza CreditAttribution: Jaza commented@bdragon: I think that the category-cat and category-cont node types should still be provided, and that being module-defined node types, they should still be defined through
hook_node_info()
(if they're enabled, of course). The new node type system in 5.0 supports a clear distinction between user-defined and module-defined node types, and the category-cat and category-cont node types definitely fall into the latter category.Comment #9
bdragon CreditAttribution: bdragon commentedBut there's all this code to add the ability to enable/disable category_cat and category_cont if people wish to use CCK. By converting the two types to user types, the users can just delete the content types if they want to use their own.
(See what happened to the Story and Page modules ;)
Comment #10
bdragon CreditAttribution: bdragon commented(I meant with the first sentence that there's all this code that just plain isn't needed in 5, as we have content types built in.)
Comment #11
bdragon CreditAttribution: bdragon commentedContent type settings forms work different than they used to.
Need to write a category_update() to fix up the variables, as I had to change the naming convention:
Due to node types being automatically appended in the content type settings page in Drupal 5, any "category_nodeapi_(content type)_containers" variables are now "category_nodeapi_containers_(content type)" instead.
Comment #12
bdragon CreditAttribution: bdragon commentedSomething like this should do nicely...
(Only change is to rename some variables during update 9 and add some comments.)
Comment #13
bdragon CreditAttribution: bdragon commentedfix an additional instance of variable_get('category_nodeapi_'. $type .'_containers')...
Comment #14
bdragon CreditAttribution: bdragon commentedWhoops, screwed up one of the hunks. This one won't cause patch to bomb.
Comment #15
sym CreditAttribution: sym commentedPatch installed cleanly, but there are a few errors.
1) category legacy menu item displays under admin, not under admin > Content management > category
2) The taxonomy wrapper shows as installed even though it isn't.
3) There is a CCK error on the the add category and container pages. I'm not sure if this is to do with CCK or category, but I've not seen it before I installed category with this patch.
Apart from this, is there anything else stopping it going in?
Comment #16
Permanently Undecided CreditAttribution: Permanently Undecided commentedSubscribing to this issue
Comment #17
forngren CreditAttribution: forngren commentedsubscribe
Comment #18
DayShallCome CreditAttribution: DayShallCome commentedPatch seems fairly solid to me. It going in soon?
Comment #19
Jaza CreditAttribution: Jaza commentedDrewish and Bdragon, thanks for your work on getting the ball rolling with this, and for taking the initiative to start work on the 5.0 upgrade patch for category. I've finally gotten around to reviewing the patch, and to working on it myself, with the aim of bringing it closer to readiness for being committed to HEAD.
Updated patch attached. Some of the things that I've fixed up so far:
$node->content
, instead of the crappy 4.7 method of appending output straight on to$node->body
.t()
calls to use proper placeholders (may still need more work).This is still a work-in-progress. Will be posting another patch soon.
Comment #20
Jaza CreditAttribution: Jaza commentedUpdated patch. Changes:
I think that's pretty much everything that's needed to upgrade the whole category package to 5.0. Testing and reviews welcome. I'd like to get a bit of testing by other people before I commit the upgrade. Apart from the things listed in this thread, the category module should function pretty much the same as it does in 4.7. This is by and large a maintenance upgrade, not a new-features upgrade. New features for 5.0 can be submitted as separate issues later on.
Comment #21
DayShallCome CreditAttribution: DayShallCome commentedThanks for the hard work, Jaza (and others). I'll patch and test sometime today or tomorrow.
Comment #22
Permanently Undecided CreditAttribution: Permanently Undecided commentedI tried the update with a test site I'm working on, with almost 300 categories and a complex hierarchy. Here's my update experience (e.g. not on a clean install):
This is all the testing I did. The really upsetting thing was finding that my site wasn't working at all because the default category and container type were not enabled, so I'd suggest enabling them or somebody else will have a shock. Thanks for the hard work!
Comment #23
Permanently Undecided CreditAttribution: Permanently Undecided commentedAfter some more testing, I can say that (in relation to the points listed above):
7. Okay, I tested and retested with Views and the View Theme Wizard and checked my templates again and again, and according to Views I should get a set of category links, when instead I get the output 'array'. If you need more info, I created a List View and set it to display Terms for a certain container, with the container's name as label (e.g: Product: pens). This worked great before the update, now it doesn't anymore. According to Views everything is fine, so is this is a category_views module error?
8. I have successfully managed to get the CCK content type to realize it's a category and not a container by going to admin/content/types and editing the content type settings. During the update the setting 'Category behavior': category setting got unset, so this is why I got the weird behavior reported above. After resetting that option, the content type worked fine as a category again.
Comment #24
Permanently Undecided CreditAttribution: Permanently Undecided commentedMore on 7):
With a quick
<code><?php print_r($node); ?>
, I found something interesting:Could this difference in structure (and the mere presence of both taxonomy and category) be the cause of the 'Array' output in the List View?
Comment #25
Permanently Undecided CreditAttribution: Permanently Undecided commentedMore info:
7) is definitely a Views.module problem and not a category_views problem, because I just tried a List View with only taxonomy enabled on a fresh install, and the terms were not displayed. So I think we can assume that category_views is working fine
Also:
10) while trying to fix 7, I decided to run a bulk update on my test site with many categories, and everything worked without a single problem.
Comment #26
Jaza CreditAttribution: Jaza commentedThanks for your testing, PermanentlyUndecided. It seems that the majority of the problems you experienced were due to the 4.7 -> 5.0 upgrade not working smoothly. Previously, I didn't test upgrading a 4.7 site with category to 5.0. I just tested on a fresh install of 5.0, and I assumed that the update script (already written by the people who started this thread) was all done.
I have now tested the upgrade path, and I saw that the update script wasn't at all ready. Variables were getting incorrectly renamed. Node type names were getting incorrectly renamed. Queries were written with incorrect syntax. It was barely working. No wonder your testing turned up so many problems.
Attached patch fixes the upgrade path for category and for category_transform. Should all be smooth sailing from 4.7 to 5.0 now. More testing is welcome, but I am setting to RTBC, and I am planning to commit this patch within the next few days, unless more major bugs are found with it.
Comment #27
Jaza CreditAttribution: Jaza commentedNew patch that fixes the hook_activeselect implementation to work with the 5.0-patched version of activeselect (see http://drupal.org/node/104478 for the activeselect 5.0 upgrade patch). This hook implementation still needs some work. Seems to work pretty well for the 'add/edit category' pages, but not so well for complex distant-parent categorised node forms.
Comment #28
Permanently Undecided CreditAttribution: Permanently Undecided commentedI installed a backup of the 4.7.4 version of my test site, and tried the update again using the patch provided in #26, and this time I only had to reinstall the taxonomy wrapper, everything else worked smoothly. Great job, Jaza, thanks! I've never used activeselect module, so I wouldn't know if it works properly or not with the patch in #27, sorry I can't help.
One curiosity, related to the 4.7->5.0 upgrade. In 4.7, this is what a category node looks like, with category_display set up accordingly:
In 5.0 this is instead what the same category node looks like, in any theme (i.e. not a theme issue):
Is this normal, by design, or something due to the upgrade? I really preferred the body of the category showing up before the list of subcategories and the cat-display links, rather than afterwards, since I generally use the body to explain what the category is about, which is nice to know before the subcategories are listed. If it's by design, can it be overriden in a theme to get the old display back?
Comment #29
Jaza CreditAttribution: Jaza commentedAwesome! Thanks for all the hard work on developing, testing, and reviewing this patch, guys. Attached patch committed to HEAD. I am about to create a new 5.0 branch for the category module.
Comment #30
Permanently Undecided CreditAttribution: Permanently Undecided commentedYou rock, Jaza! Just tried the release version and everything works smoothly, problem in #28 solved as well. Thank you so much!
Comment #31
(not verified) CreditAttribution: commented