The book wrapper seems to be busted for Drupal 5.2 and Category 5.x-1.x-dev.

I saw another post about the tax wrapper having same issues but thought i'd post this separately in case not the same issues.

I replaced book files for both core and the wrapper. In module listing it shows book as being under core. Under Category settings it shows the wrapper as installed (which would be wrong). I have a book which seems to be working fine - but i have category pages which now list double navigation links at the bottom of my page.

If i select uninstall for the wrapper i get page not found.

also, i think if i manually put the wrapper in then my double links go away - but now my books are busted

CommentFileSizeAuthor
#4 category.module.181597-1.patch588 bytesbengtan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

liquidcms’s picture

well lokoing at code where cat module determine if wrapper is installed (sicne this is the first obvious issue here) it looks to read the code:

module_exists('book') && !menu_get_item(NULL, 'admin/content/book')

and i think the book module exists regardless so i am guessing that there must be a different menu item and this one is corrupt - so i deleted it manually from the db and now i see that wrapper is not installed (which is correct).

but now when i try to do the install i get Page not found.

liquidcms’s picture

Title: book wrapper doesnt work. » code is missing for wrappers.

ok a little more digging and definitely some issues here.

the 4.7 version has a function called category_wrapper which gets called by the link to install/uninstal of the wrappers.

this function is still required by the menu hook but has been removed in the 5.x version; but has been replaced by a _category_wrapper function in category_wrapper.inc - but this file never gets included (except when the module is enabled for some reason - but that doesnt help us at all!!).

so in other words, page not found get generatde when the drupal _menu handler can't find the callback function (category_wrapper)

pretty messed up

liquidcms’s picture

ok, going back to 5.x-1.0 of category i can see that the missing code for the wrapper is now back... and sure enough the install/uninstall works correctly...

BUT - the book wrapper doesn't actually work - my books are busted.

hmmm.. so is it safe to say that the category module isn't ready for Drupal 5 yet??? that kinda sucks.

bengtan’s picture

Status: Active » Needs review
FileSize
588 bytes

Hi,

Came across the same issue while evaluating category.module, and I've got a potential patch/fix.

Seems like category_wrapper() got renamed to _category_wrapper() a bit after 5-x-1.0, but the menu callbacks weren't modified to reflect this. My patch creates a menu callback function to execute the correct code.

To the maintainer and other interested parties: please review and test, and if satisfactory, check it in.

Thanks.

bengtan’s picture

Oops, forgot to say. My patch is against 5.x-1.x-dev of 2007-Aug-22, not whatever's in CVS HEAD.

liquidcms’s picture

ok, thanks for this.. i'll give it a shot.. i did try to mod the calls to the function and was able to fix the install/uninstall part - but the wrapper still didn't work - my existing books were busted and there was no node/add/book

maybe your solution works better.