Needs review
Project:
Advanced Book Blocks
Version:
6.x-2.5
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Anonymous (not verified)
Created:
24 Jan 2011 at 02:45 UTC
Updated:
28 Jul 2022 at 22:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
espirates commentedsubscribe
Comment #2
shunting commentedSubscribe
Comment #3
Anonymous (not verified) commentedjQuery Menu 7.x-1.0 has now been released.
Anyone considering porting Advanced Book Blocks?
(Eventually I will probably do it if no one else does... but it may not be for another year...)
Comment #4
nmudgal commentedComing from the issue #1508832: Support +/- expand/contract in Book navigation on Drupal.org, I actually started porting this module [namespace is different] to d7 so attaching the current work [though it may not be in working condition] so if someone is interested can take it forward or I will be trying to complete in upcoming days.
What is complete :
What remains mainly:
Thanks
Comment #5
nouriassafi commentedOkay, I have started porting this module to Drupal 7. Hopefully, will deliver in a couple of days.
Comment #6
Anonymous (not verified) commentedHooray! Thank you very much!
Comment #7
nouriassafi commentedOkay, there we go.
I have uploaded the code to git:
http://drupal.org/sandbox/nouriassafi/1576288
As always, your feedback is welcome.
Comment #8
Anonymous (not verified) commentedThank you very much indeed for this!
I've installed and enabled it, with jquery_menu, in a new local D7 instance, and have begun testing.
I have almost no experience with D7, so I may make some dumb mistakes.
Here's what I've seen so far:
After creating the first book, it took me to /admin, which doesn't exist. (There would, apparently, need to be a #overlay in the URL.) This might be a D7 bug rather than an ABB bug.
After assigning the block to a region, it didn't appear. After a bunch of poking around to see why not, I created a new dummy block and assigned that to the same region. The ABB block then appeared. After deassigning the dummy block, the ABB remained visible. (Again, this seems like it may be a D7 problem rather than an ABB one.)
I am getting a warning, everywhere the block appears:
* Notice: Undefined variable: edit_path in recursive_link_creator() (line 284 of /Applications/MAMP/htdocs/sites/all/modules/jquerymenu/jquerymenu.module).
There are as many copies of this warning as there are book pages, so presumably it is getting it once per page.
Taking a quick look at the code, it would seem from the structure of the IF branching that jquerymenu_edit_link must be turned on, but that the items have neither an edit_path nor an mlid.
There is something wrong with the sorting of books based on the weights set in the configuration:
With:
Book 1: weight -15
Book 2: weight 4
Book 3: weight -15
the order of appearance is Book 1, Book 3, Book 2; it should be Book 2, Book 1, Book 3.
With:
Book 1: weight -14
Book 2: weight 4
Book 3: weight -15
the order of appearance is Book 2, Book 1, Book 3, which is correct.
I've verified that "Automatically enable" and "Lock this block to new books" both work.
I haven't tried testing the taxonomy automation; it's not something I use in D6.
Comment #9
nouriassafi commentedI have tested the above module against the latest dev release of jquerymenu on a fresh Drupal 7.14 installation and have not seen any of the above. Could you update jquerymenu to the latest dev and re-test?
Comment #10
Anonymous (not verified) commentedThanks, good guess! I had an old dev version of jquerymenu. Updating it solved the undefined variable error.
I'm seeing some other things which I'll report in separate comments, to make it easier to keep track.
Comment #11
Anonymous (not verified) commented[Updated title to reflect the current use of the issue]
I am seeing a problem with what level of the menu hierarchy is opened when I have several levels.
The problem seems only to affect leaf nodes (i.e. ones with no children).
When viewing a leaf node, the menu is open only as far as its parent. The leaf node itself is hidden.
Comment #12
Anonymous (not verified) commentedI am sometimes receiving the following series of error messages when saving the ABB configuration:
Notice: Undefined index: terms in book_blocks_config_submit() (line 317 of /Applications/MAMP/htdocs/sites/all/modules/drupal_7_port_of_advanced_book_blocks/advancedbookblocks.admin.inc).
Notice: Undefined index: terms in book_blocks_config_submit() (line 317 of /Applications/MAMP/htdocs/sites/all/modules/drupal_7_port_of_advanced_book_blocks/advancedbookblocks.admin.inc).
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'weight' at row 1: INSERT INTO {adv_book_custom} (delta, bid, enabled, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 14 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => ) in book_blocks_config_submit() (line 353 of /Applications/MAMP/htdocs/sites/all/modules/drupal_7_port_of_advanced_book_blocks/advancedbookblocks.admin.inc).
I am not yet sure what circumstances trigger the error. I think it has something to do with taxonomy automation; I did not get these messages before starting to test that.
Comment #13
Anonymous (not verified) commentedSometimes when saving a book, I get the error message:
Notice: Undefined variable: node_terms in _advancedbookblocks_node_op() (line 328 of /Applications/MAMP/htdocs/sites/all/modules/drupal_7_port_of_advanced_book_blocks/advancedbookblocks.module).
Comment #14
Anonymous (not verified) commentedI have tested the automation settings.
Three of the five work perfectly. The two that don't are the term-using ones.
Mass enable and mass disable apply the term settings correctly.
However, when using the term-based automation modes, creating a new book never adds it to the menu, regardless of what its term is.
Comment #15
Anonymous (not verified) commentedSorting: it works. My report in #8 that it didn't was confused.
Testing finished for this round!
Comment #16
nouriassafi commented#11 This is a jquerymenu issue which can easily be resolved as described here:
http://drupal.org/node/344916#comment-4621198
Comment #17
that0n3guy commented@nouriassa, I agree with #11, there is an issue, and the solution you posted doesn't work (I'm using jquerymenu 3.x dev... this fix is in there) for this issue. This module needs to make the active menu
I tested a solution where I went in with chrome and added an "open" class to the
$('ul.jquerymenu .open').parents('li').removeClass('closed').addClass('open');from within the Chrome console, it expanded the menu like it was supposed to.So basically we need to to tell jquerymenu what item is the "active" menu item.
Comment #18
that0n3guy commented#11 was easily fixed I figured out. No patch, but in adancedbookblock.module, in function advancedbookblocks_block_view, and after this code:
Add:
This will fix the issue.
Comment #19
Anonymous (not verified) commentedI confirm that #18 works. Thanks!
Comment #20
nouriassafi commented#12, #13, #14 Fixed and committed to Git.
NB Once you enable the module or reset any of the blocks, you must save the configurations or the blocks will not appear.
Comment #21
Anonymous (not verified) commentedCool, thanks!
It looks like you have not included #18?
Comment #22
Anonymous (not verified) commentedNew problem: I deleted all my existing book pages to start testing over again. On doing the mass delete operation, I got:
Notice: Undefined property: stdClass::$book in _advancedbookblocks_node_op() (line 313 of /Applications/MAMP/htdocs/sites/all/modules/drupal_7_port_of_advanced_book_blocks/advancedbookblocks.module).
Comment #23
Anonymous (not verified) commentedI'm still getting the #12 problem:
Notice: Undefined index: terms in book_blocks_config_submit() (line 321 of /Applications/MAMP/htdocs/sites/all/modules/drupal_7_port_of_advanced_book_blocks/advancedbookblocks.admin.inc).
I thought maybe I had failed to download the new version, but now the error is at line 321 instead of 317, which suggests I have new code.
Comment #24
nouriassafi commented@that0n3guy #17 jquerymenu 3.x dev does not include the fix mentioned in #12. (It only deals with the .open class not the .active one.)
Comment #25
Anonymous (not verified) commentedRegarding the NB in #20: I have observed this. Enable the module, save config, create first book, the block doesn't show, save the config again, now the block shows. This is probably the same thing I mentioned seeing in #8.
This is not a good user experience—some people will decide that ABB just doesn't work and give up.
It's not serious enough to hold off on marking this RTBC, but I'd open a new issue for it after that, if it's not easy to fix now.
Comment #26
Anonymous (not verified) commentedI'm testing the taxonomy term based automation modes.
Set the mode to "automatically enable new books".
Create a new book (B1) with term "excluded".
It appears in the block.
Now set the mode to "automatically exclude books with selected terms" and set the term to "excluded".
Save the config.
B1 now disappears from the menu.
The documentation label says "this will only alter the enable settings when books are added or edited", so the documentation doesn't fit the behavior.
I don't know what the intended behavior was, or what it did in the 6.x versions. However, either the documentation or the behavior should change.
Comment #27
Anonymous (not verified) commentedI have not seen problem #13 again (but I only got it occasionally before, so I can't be positive it's fixed).
#14 seems to be fixed except for the issue I noted in #26.
Substantial progress!
Comment #28
nouriassafi commented#22 #23 #25 Fixed and committed to Git.
Comment #29
cyrilarnaud commentedThe block works perfectly fine while i'm connected as an administrator but I have this error on each page displaying the block when I'm logged in as non-admin
Exception: Query tagged for node access but there is no nid. Add foreign keys to node.nid in schema to fix. in _node_query_node_access_alter() (line 3250 of /home/users4/o/ocolot/www/dataforevents/modules/node/node.module).
I'm using the latest git version.
Comment #30
nouriassafi commented@cyrilarnaud #29 should be fixed now. Could you check and confirm?
Thanks in advance.
Comment #31
cyrilarnaud commented@nouriassafi : thanks the latest git version solved the problem #29
Thanks a lot
Comment #32
Anonymous (not verified) commentedOK, I have confirmed that #16 is correct (and #17 is incorrect). In the current jQuery menu -dev version, the patch at http://drupal.org/node/344916#comment-4621198 was mistakenly applied only to jquerymenu_no_animation.js, not to the main jquerymenu.js .
So, #18 (although it works) is not the right solution.
Comment #33
Anonymous (not verified) commentedOK, at this point the only remaining issue seems to be #26 (taxonomy automation does not work as documented, although it may work the same way as in 6.x and/or as intended).
I think it's time to mark this RTBC, and we can open a new issue for #26.
Congratulations and thank you to @nouriassafi!
Could the official maintainers please create a 7.x version?
Comment #34
karibel commentedAny idea when it's possible to see an official (dev or beta) 7.X version? Keep up the good work.
Comment #35
Anonymous (not verified) commentedIt appears that the module was abandoned by the original developer/maintainer.
At http://drupal.org/node/251466 there is an explanation for how someone (probably @nouriassafi) could become a (co)maintainer and release an official 7.x version.
Comment #36
albert.aribaud commented@nouriassafi: thanks for the porting. Just added it (and the latest dev of jquery menus) to my D7 site.
Only issue I had was a succession of
Notice : Undefined index: href in recursive_link_creator() (line 217 in .../sites/all/modules/jquerymenu/jquerymenu.module). I assumed it was due to some node(s) in my book not being published, so I did a dirty fix by making sure that href was defined even for unpublished pages, by copying line 230 and inserting it at line 235, i.e. turning:into
This removed all the warnings I had.
nouriassafi: if this fix is good enough, maybe you could push it in your git repo? Also, I'd like the module to be officially maintained for D7. :)
Cheers,
Albert.
Comment #37
lolandese commentedChanged title to make it more distinctive in the "Track posts" block on the dashboard.
Comment #38
Bojhan commentedCould this get some activity, the warning is removed but I doubt its the correct fix. As jQuery Menu changes.
Comment #39
Anonymous (not verified) commentedI am still seeing the "Undefined index: href in recursive_link_creator" warning in the site log.
Comment #40
anibal commentedsubscribe
Comment #41
anibal commentedHello all,
Any ideas when there will be a dev version available (not git) on drupal.org?
Thank you for the effort on making this port.
Comment #42
nasia123 commentedThis module works, tested it with drupal 7.22 and 7.x-4.0-alpha3 ...
this is the notice I am getting
Notice: Undefined offset: 116 in book_blocks_config_submit() (line 314 of C:\inetpub\wwwroot\wiki\sites\all\modules\advancedbookblocks\advancedbookblocks.admin.inc).
Comment #43
webel commentedThanks for your work on this.
With Jquery Menu 7.x-4.0-alpha3 when I save an Advanced Book Blocks configuration I also get dozens of times with different indices:
Comment #44
webel commentedThe error reported at #12 is definitely still present in the GIT snapshot from 2012-05-04. Whenever I change any Advanced Book Block settings of any kind I get 100s of messages like: