Most of my book pages end in a number and it seems that whenever I reach 10, the ordering is messed up and I have to mannually re-order the book to get it working properly

What ends up happening is this
_____

1
10
2
3
4
5
6
7
8
9
____

The page that ends in "10" is ordered to follow after page one and if I don't manually lower it, any following pages will continue to be added after 10 instead of 9, like so:
_____

1
10
11
12
2
3
4
5
6
7
8
9
____

Has anyone else encountered this bug? This is extremely problematic when you have many books being created that have 30+ pages.

Comments

WorldFallz’s picture

"end in a number" where? The title? If so, this is not a bug-- titles are text and this is a correct text sort order.

highvoltage’s picture

Ack, sorry for not mentioning this. The number is the only thing determining the order. The text that preceeds it is always the same.
_____

Page 1
page 2
Page 3
Page 4
Page 5
_____
I also did some more testing and found that It's related to the top level book page being reloaded somehow. I added 5 pages to a book using the "open in new tab"(firefox) for each form instead of loading it on the current page. After adding those 5 I refreshed the top level book page and added another 5. This time page number 10 followed after page 5, the last page i created before refreshing the top level book page showing the updated book navigation. Is the order not known to the book before it's top level page is refreshed and therefore it adds page 10 and subsequent pages after the last known page? 1 in the case of no refreshing and then whatever number you refresh at and begin adding again?

It went
_____

1
2
3
4
5
10
6
7
8
9
_____

Bewildering why it's always page ten that begins this problem.

WorldFallz’s picture

Sorry I don't mean to be thick, but I still don't know what 'number' you keep referring to. There are no "Page 1" type numbers on a book. Where is this coming from?

highvoltage’s picture

All the child pages of my book carry the title of book itself. If the book is named "monkies" the children pages are named like this:

monkies 1
monkies 2
monkies 3
monkies 4

etc.

WorldFallz’s picture

So as I said above, those are not 'numbers' in the traditional sense-- they are merely text characters that represent numbers to a human, but in the context of the title the computer doesn't know the difference. I don't know why the '10' would show up in the middle of tha pack like that, but this:

1
10
11
12
2

and

Monkies 1
Monkies 10
Monkies 11
Monkies 12
Monkies 2

are in absolutely correct text order. You can't alphabetize numbers treated as text 'correctly'.

highvoltage’s picture

o_O Hmm, well I find that a bit hard to swallow considering somebody would have a need to do so somewhere and you see properly numbered titles all over the place on the internet(they can't all be hand crafted), and you'd think if there was no way to order strings with numbers properly that would be a huge problem across the entire web... Seems like a pretty unrealistic limitation but I don't know enough about it to discuss that part of the issue.

So, the question becomes... Why does the title of a book page override its position in the creation? If you have ten pages, and you create another one, it should come after those already existing regardless of alphabetical ordering, right? Pages in a book shouldn't force alphabetical organization. That's just... crazy. Pages can be titled any number of things where alphabetization is irrelevant. So, as a default, they should be weighted in the order they've been added.

Also, the fact that when I refresh the top level page after creating a number of children, and then start adding new ones, it does not order alphabetically but instead begins after the last created node prior to the refresh is still left unexplained. That would imply that there's something dependent on the top level page being refreshed after each child page creation(dev expected people to be using only one window?), to create proper weighting of pages.

Is it not able to apply weights by order of creation properly without that top level page refresh, and is therefore handing out weights during the refresh by alphabetizing the children?

WorldFallz’s picture

I can't speak to how other places on the internet solve the problem (it all depends on the backend), but there's a couple of options in drupal. Nodes in a book also have a 'weight' (located in the 'book outline' fieldset) where you can manually specify the order. You can also reorder the pages at admin/content/book.

As for why the title overrides creation date-- it's simply because the default order is alphabetical not by date.

What's crazy is that you think because you want pages ordered by creation date that everyone else does as well, lol. I have an extensive intranet site made up almost entirely of book pages and the very last order I would want is by date. Remember, not every use case is your use case. A well designed system picks a sensible default and allows for changes to accommodate other possibilities.

Sorry, I have no idea what the problem is with your refresh though-- I frequently create and/or edit pages in multiple browser windows all the time and a quick refresh of the parent page reorganizes everything just fine.

highvoltage’s picture

Ok no. What I said was that it's more likely that a pages title is unrelated to it's order in the book than it being the basis for ordering a book. A book is for hierarchical content, NOT alphabetical content. It's not "lololol alphabetize module!!!", it's the book module. Even the item it's named after doesn't have it's chapters alphabetized. What if you where trying to create that? What if you need usersto create add child pages without giving them access to administrate books? The use cases for alphabetize by title as a default are a drop in the bucket compared to those where the title is irrelevant to the order of the pages. The majority use cases should be the default, and at the very least there ought to be sorting options.

"A well designed system picks a sensible default and allows for changes to accommodate other possibilities."

A well designed system supports the majority use case as the default. Hierarchical != alphabetical.

The book is not well designed. Drupals ability to create hierarchical content is about as good as it's file management. AKA pure archaic garbage and probably one of the reasons drupals popularity is so deeply low compared to other site building solutions, but it's what's available and I've gone far enough with drupal that restarting with another cms is not an option.

"Sorry, I have no idea what the problem is with your refresh though-- I frequently create and/or edit pages in multiple browser windows all the time and a quick refresh of the parent page reorganizes everything just fine."

The refresh isnt a problem with my site only. It occurs in a new install, I tested it myself.

vm’s picture

one of the reasons drupals popularity is so deeply low compared to other site building solutions

Deeply low popularity must be why drupal doubles its user base and deployment by 100% every year and continues to win awards.

Drupal developers will welcome your expertise in this area to help make the book.module better for all use cases. Feel free to add patches to the issue queue so that they can be reviewed and is they pass the muster, add to core.

highvoltage’s picture

I think you need to watch the why drupal sucks video and then come back so I can welcome you to reality. I found that drupal has a very small but fanatic fan base which actively lauds, and publicizes drupal while seeing it through rose colored glasses. They're the reason I've ended up with it, often to my great resentment, as I found it to be much less of the pretty picture they painted. In fact I feel like I'm fighting it every step of the way rather than it enabling me. But the reality outside of that fanboi group is that it's not popular at all. That is not helped by the fact that the fanbois rabidly resist any criticisms, so the problems holding it back remain.

Drupal may have its good points but it also has a lot of archaic limitations due to an unwillingness of the community to accept differing opinions from users on what the best way to do things is. Popularity is the ultimate judge of success. The drupal of today is not a winner by that metric.

I also don't appreciate being mocked for making a reasonable assessment of what the majority use case for the book module is likely to be.

... but all this is beside the point of the thread.

vm’s picture

I've seen it and noone is saying drupal is perfect. There is no such thing as perfection IMO and it's only a fools dream to believe perfection in anything will ever be attained.

The only thing holding drupal back from anything is the lack of manpower not lack of opinions. Drupal needs people willing to get their hands dirty and contribute more than an opinion. The "users" far outweigh the people willing or able (based on their skillset) to contribute. Opinions and criticisms are fantastic, however opinions and criticisms alone, don't get code written ... ever.

At this time the book.module works on a weight system to order child pages. If you don't want to use weights, you will have to find a different method.

highvoltage’s picture

... Weights are fine. It's how that system is miss-ordering my pages that is the issue of this thread. I'm trying to figure out why what I'm seeing is happening!

vm’s picture

which version of drupal is in use? You failed to tag the thread.

highvoltage’s picture

Sorry, drupal 6.

If it weren't for the fact that when I tried refreshing the page and then adding the final pages and page 10 ended up following page 5 instead of page 1, I'd assume it was just alphabetizing it, but I don't know what to think at this point due to that. It would be nice if somebody who knew the book module code and how it orders pages could comment on this...

WorldFallz’s picture

Sorry again, but hierarchical most certainly can equal alphabetical. The dictionary definition of hierarchy is "a graded or ranked series". There are many ways to create a hierarchy-- alphabetical is one, numbered is another, date order another. I can't say for sure, but alphabetical was probably choisen as the default because then book page order can be most easily manipulated with titles (and thus avoid having to use weights) unlike date order forces you to use weights if you don't want the default. Which, by the way, was exactly what you were trying to do-- your lack of understanding how alpha digits are alphabetiized is was caused the problem.

Oh and if you want "someone who knows the book module code" to see your problem, the best way to do that would be to create an issue in the drupal issue queue with 'book.module' as the component.

Also... I wasn't mocking your assumption of the use case-- i was trying to point out that assuming your use case is the most common is often faulty.

As for the misplaced '10' i have tried to recreate this behavior several time and I can't seem so to it. I would verify the order at admin/content/book, try different browsers, and clear the cache (both the browser cache and the drupal cache).

Bobby1290’s picture


"A book is for hierarchical content, NOT alphabetical content."

This is but 50% accurate, a book is for hierarchical content, but within the same hierarchy pages are alphabetically ordered (by page title).
Hierarchy does not mean numerical ordering, it means ordering per level.

And book pages have NO page numbering.
In the alpha system
'armando' comes before 'b' and after 'a'
similarly
'123455' comes before '2' and after '1'

To get your desired effect, just name with all decimal positions, so that the alphabetical order within one hierarchy can be correctly determined.
e.g.
If you have a maximum of 99 pages
01
02
03
..
Page 01
Page 02
Page 03
Why call them "Page" if it's just being repeated ?.....(rhetorical)
Have 999 pages --> use 3 alpha positions...9999 pages...you get the idea.

Why the 10 comes after the 5? This might be a cacheing idiosyncrasy, could also be that page got a different level(weight), but in any event, if that is such a big issue for your project report it at the issue queue for the Drupal project http://drupal.org/project/issues/search/drupal?text=&assigned=&submitted...

You could also of course make a module to (alpha)order '10' after '9'.

Hope this helps.

highvoltage’s picture

Hmmm, thanks for this information. I guess I'll have to resort to using pad numbers for the time being, though it might be a headache sorting out user error. Ah well...

"Why call them "Page" if it's just being repeated ?.....(rhetorical)"

I'll answer anyway :P

I don't really call them page it was just an example, they're titled after the name of the book and the book is an easy way to create a hierarchy to organize series' and their episodes where it's "[series-title] episode 1" and so on.

Bobby1290’s picture

Funny, how two people can view the same challenge and 'see' totally different solutions.

I would just make a list with a pager that can contain 1 item per page, call the list "[series-title] episodes"(could be a category) and then have the user input the episodes per date, like making simple blog posts.
The list (if set to ascending per creation timestamp in sql,drupal api or views) would display 1 episode per page, giving you automatically the numbering you are looking for, and a navigation at the bottom of the page that would look like:

<first><previous> 1 2 3 4 5 6 7 8 9 <next><last>
The episodes could just have a normal title name not bound to any ordering system (or with the "episode xx" in it for search indexing purposes).
And there would be little chance for user error.

But of course, this is just a thought with the little info we have.
You might have a reason why you have to do it with book structure.

But there is a lot of ways to accomplish something in drupal, and that is the strength of drupal.
You just have to think outside the box (read Book). ;)

Sound like a nice project, good luck.

highvoltage’s picture

Thanks :P

That is a good idea. The reason I originally chose book is it was the most obvious solution out there. When I was sorting out how to make my site, I didn't have much knowledge of drupal(still don't honestly. I take it day by day), so I've had to learn as I went, and for some of the most fundamental features that everything else is built around I had to choose early, and that meant the most obvious and simple solution.

One thing I liked about the book module was the continuity of the whole creation process. You can add a child right from top level page, it creates appropriate breadcrumbs, and it gives you last page and next page navigation on the children pages. Getting a relationship between the episodes and the series wiki page so the breadcrumbs work might be difficult with using a views list, and I'd have to have a menu item to for each node type separately rather than just the add child link that book provides. Maybe something like node relationship module would help there I don't know. Sometimes it's like having to try on every shoe in the store before you find one that fits... It's exhausting. So yeah, book won that contest due to being obvious and simple for my level of knowledge.

I'm sure an expert drupal guy would breeze through the whole thing and create an ideal solution, but I'm just a lowly noob crossing bridges when he gets to em. \O_O/

Anonymous’s picture

I seem to be encountering a problem with the books module ordering pages that has to do with upper/lower case.

Let's say I have 4 book pages:

Times
TIS
Turtle

Since the titles should be alphabetically ordered, the above ordering should be the correct version, however, I'm getting the following results:

TIS
Times
Turtle

Notice how uppercase letters precedes lowercase letters... I'm assuming this is due to the fact when converted to decimal values uppercase letters are always greater than lowercase, is there anyway to get around this problem without directly modifying source files or manually assign different weights to the individual pages?

Thanks!