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.
Is there a Drupal 6 version planned? Drupal 6 alternatives?
Would be glad to know.
Comment | File | Size | Author |
---|---|---|---|
#26 | html2book.module-fixed.diff | 2.37 KB | keinstein |
#26 | html2book.module | 7.95 KB | keinstein |
#25 | html2book.module | 7.94 KB | druvision |
#21 | html2book_progesterone.txt | 7.55 KB | progesterone |
#17 | html2book.module.txt | 7.17 KB | junedkazi |
Comments
Comment #1
druvision CreditAttribution: druvision commentedComment #2
looplog CreditAttribution: looplog commentedIs the maintainer out there? I tried to wrap my head around how this module works, but between that and trying to grok the changes to the way book works in menu for 6.x, I got completely lost. I also tried running this module through deadwood conversion module but the result is no different. It also, not surprisingly, produces absolutely no results.
Any chances of an update to this extremely useful data entry module?
Comment #3
Hoditz CreditAttribution: Hoditz commentedI second the request. This module is important for my sites and without it I can't upgrade to 6...
Can anyone help?
Comment #4
dugh CreditAttribution: dugh commentedsubscribe
Comment #5
adam_b CreditAttribution: adam_b commentedsubscribe
Comment #6
junedkazi CreditAttribution: junedkazi commentedHi
I love this module. So I have started work on it. I think I will have something out
within a week's time.
Thanks
Juned Kazi
Comment #7
KarenS CreditAttribution: KarenS commented@jundkazi, thanks, I appreciate the help. I just have not had time to do anything with this yet.
Comment #8
junedkazi CreditAttribution: junedkazi commented@KarenS
I have tried to upgrade the module but faced lot of problems. I am attaching the patch files below.
Comment #9
junedkazi CreditAttribution: junedkazi commented@KarenS
The problem which I faced is as follows:
In D5 the "html2book_split" function was called in "submit" case of the nodeapi which has now changed to
"presave" in D6. So when I call the html2book_split function under the nodeapi presave case it does into
an infinite loop.
On further debugging I noticed that the node_save function in html2book_split is itself calling the presave
case at the beginning of the nodesave function.
So as of now I have changed the nodeapi case to insert. The module is working fine except that the parent
node is picking up the whole HTML and its child nodes are created properly.
Comment #10
junedkazi CreditAttribution: junedkazi commentedI am also attaching a tar ball of the whole module in case the patches don't work
Comment #11
junedkazi CreditAttribution: junedkazi commentedComment #12
junedkazi CreditAttribution: junedkazi commentedhere is a working copy of the module file.I am just attaching it as a txt file.
Please rename it to .module again.
This is just an attempt. It has not been tested for edge cases.
If you come across any bugs pls report it here and I will try and fix it.
Comment #13
Hoditz CreditAttribution: Hoditz commentedThank you so much.
I've installed the module in my Drupal 6 test site and I made some simple tests. I'm happy that the module is functional and I'm planning now to upgrade my sites. There's a problem, but I don't know if it's solvable - maybe it's a book module issue, a weight problem, or maybe I didn't found yet the correct procedure.
Basically it's about the order of child pages - the table of contents for the new book is listing the subpages in alphabetical order, or numerical order (if the chapters are numbered), instead of respecting the order in the source file.
Example: if the chapters in the source file are, in order: Chapter, Achpter, Hcapter, Tchaper, Echaptr - then html2book is generating an alphabetical toc: Achpter, Chapter, Echaptr, Hcapter, Rchapte, Tchaper.
Another example - headers in source file: I, II, III, IV, V, VI, VII, VIII, IX etc. - but generated table of contents: I, II, III, IV, IX, V, VI, VII, VIII.
A final example: names of chapters in the source file: 1, 2, 3, 4, 5... 10, 11 etc. - result after html2book: 1, 10, 11, 2, 3 etc.
Of course, Drupal 6 has drag and drop and it's easy now to rearrange the chapters of a book. But for books with many chapters it would be great if a solution can be found. Html2book should order the child pages exactly in the original succession.
In the html2book for Drupal 5 the table of contents was correctly produced, in general, but the same disorder was produced if editing anything in the outline view.
Again, I need to use more the module to be sure, but I think this is a issue to be resolved.
Thanks again.
Comment #14
junedkazi CreditAttribution: junedkazi commented@Hoditz
Thanks for pointing that bug out. Can you please try again with this file.
Thanks
Juned Kazi
Comment #15
Hoditz CreditAttribution: Hoditz commentedThanks.
The new code gives an error on line 112 - Class 'Logger' not found.
Commenting out that line, the module seems to function properly.
Comment #16
junedkazi CreditAttribution: junedkazi commented@Hoditz
Sorry for that . That was a debugging statement which I use. we can comment that line.
Thanks
Juned Kazi
Comment #17
junedkazi CreditAttribution: junedkazi commentedI am attaching a new file after removing the Logger statement .
Comment #18
Hoditz CreditAttribution: Hoditz commentedThank you, the error is corrected.
From my point of view the module is functional and will start using it in production soon.
I'll be able to test it more thoroughly, with a variety of books. I'll report here if problems occur.
(Some unwanted rearrangements after editing in "edit order and titles", just as in the D5 version).
I believe the module is ready for deployment for Drupal 6 users - thanks again, junedkazi (and also KarenS).
Comment #19
junedkazi CreditAttribution: junedkazi commented@karenS,
Can u please review the code and can we have a dev version or something like that ?.
Thanks
Juned Kazi
Comment #20
KarenS CreditAttribution: KarenS commentedOK, I finally got the D5 branch split off so we can work on D6. I committed the code above. The new -dev versions probably won't show up for 12 hours or so, then you can see if it's working correctly.
Reopen this issue only for problems with the D5->D6 port itself. If there are other bugs or problems with the way the code works, open separate issues for them.
Thanks so much for all the work junedkazi!
Comment #21
progesterone CreditAttribution: progesterone commented@junedkazi
I didn't see your contribution until I have done the working version for D6 by myself.
It is not thouroughly tested anyway. I just did the following modification to the D5 version and got D6 version.
- change from 'submit' case to 'presave' case to be compatible with D6
- set $node->html2book = 0; just after before calling html2book_split function to prevent infinite loop of calling hook_nodeapi
- Display the title of untitled page as 'Page page_number_in_node' format.
Comment #23
druvision CreditAttribution: druvision commentedThe officially committed D6 dev version doesn't create any book sub-pages, only deletes the text on the main node.
Fortunately, Patch #21 above semi-works - at least it splits the pages correctly (with the sample pages proviced on the module's description). But, the book hierarchy is flat.
Comment #24
druvision CreditAttribution: druvision commentedComment #25
druvision CreditAttribution: druvision commentedI have asked a freelancer to fix the above mentioned issues and others. Attached is a code which works in all test-cases except the last one. The last test case can easily be bypassed by doing it in two steps, with the previous test cases.
All test cases should be run on an empty drupal site, with the book navigation block on the left.
Test cases:
Test case 1:
=========
1. Add new book
2. Paste the example into the body
3. Check the split option.
4. Save the book
Test case 2:
=========
Created a new book, then add a book outline outline before saving.
Updating the book and selecting the split option, then press save.
Test case 3
=========
Create a new book node, then saved it, then edit the book node and add an outline, then press split.
Test case 4
=========
1. Create a new book node, then save it.
2. Re-edit it and select the split radio button (without creating any outline).
3. Press save.
Test case 5
=========
1. Create a new book, paste the sample html on the project description, choose the split option and press save. This creates an hierarchical book with sub-pages.
2. Go to one of the sub-pages, edit it, paste the sample html, choose the split option and press save.
3. Now, the bug: the book navigation block to the left shows the new pages as part of the overall book but when I go to the sub-pages I see that new books were created and they are not connected to the parent book. The breadcrumb displays OK.
Comment #26
keinstein CreditAttribution: keinstein commentedI updated the patch with to avoid a warning in strict php error checking mode. Since I didn't really use the module I expect more to appear.
The patch is aginst rev. 1.2 from CVS
@KarenS can you release an updated version?
Comment #27
verbosity CreditAttribution: verbosity commentedtested, works fine for me :)
Comment #28
KarenS CreditAttribution: KarenS commentedI committed this without doing any testing because it's still likely better than what is there. I botched the commit message which was intended to give credit for the patch, so sorry about that.
Please report any follow-up changes that are needed.