Klap-in / dokuwiki-plugin-bookcreator

Allow to select some pages and create a book (PDF, ODT or text)

Home Page:https://www.dokuwiki.org/plugin:bookcreator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'You don't have pages selected yet.'

ppex76 opened this issue · comments

Configuration:

Dokuwiki last stable versione Hrun
Bookcreator latest version (https://github.com/Klap-in/dokuwiki-plugin-bookcreator/archive/master.zip)
dw2pdf latest version (https://github.com/splitbrain/dokuwiki-plugin-dw2pdf/tarball/master)

browser used:
Google Chrome Version 41.0.2272.89 m
Firefox 38.0.5

Content of cookie:

array(6) { ["bookcreator"]=> array(3)
{
["wiki:ebook"]=> string(1) "1"
["start"]=> string(1) "0"
["prova_argomento"]=> string(1) "1"
}
["DokuWiki"]=> string(26) "34vthdhc62rljdtbh4bofu77r3"
["PD_STATEFUL_1f048598-f654-11e0-9132-00215e895411"]=> string(9) "/jportal7"
["PD_STATEFUL_c97d4ad4-e3a6-11e0-baf3-00215e89578f"]=> string(25) "/clustermaila01.hbl.local"
["PD_STATEFUL_ca435198-e3a6-11e0-baf3-00215e89578f"]=> string(25) "/clustermaila01.hbl.local"
["IV_JCT"]=> string(9) "/jportal7"
}

Apache/2.2.17
php version 5.3.5
mysql 5.5.8

Both browsers show this issue?

Related to #17

yes both browser

Do you see errors in the console of your browser, when adding/removing pages to the selection?

No one error browsing.

I have the same problem when i try to save the selection with the bookmanager.

Sofar I have no clue. I will test this evening again.
This issue is popping up sometimes for certain people, but so far haven't got an idea why it happens.

Thanks,
another situation that i see when erase the selection, the dump plugin show:

array(6) {
["DokuWiki"]=> string(26) "34vthdhc62rljdtbh4bofu77r3"
["PD_STATEFUL_1f048598-f654-11e0-9132-00215e895411"]=> string(9) "/jportal7" ["PD_STATEFUL_c97d4ad4-e3a6-11e0-baf3-00215e89578f"]=> string(25) "/clustermaila01.hbl.local" ["PD_STATEFUL_ca435198-e3a6-11e0-baf3-00215e89578f"]=> string(25) "/clustermaila01.hbl.local" ["IV_JCT"]=> string(9) "/jportal7"
["list-pagelist"]=> string(5) "start" }

La lista è vuota. Verifica che il tuo browser accetti i cookies e riprova a selezionare le pagine.

any idea?

Was the start page selected or unselected when you erased the selection?

list-pagelist is now filled with one page... so exporting should work now...

Edit: maybe also other variables are needed...but these could be added as url parameters to test...
If you could read PHP, see here the code of the export action: https://github.com/splitbrain/dokuwiki-plugin-dw2pdf/blob/master/action.php#L161

The plugin work perfectly but it need of one conditions,
install boookcreator
install dw2pdf

add one page and after erase the selection

if i do this, the cookie pagelist are set.

I don't understand what you say..

This could trigger a book export, like the book manager would do: ?do=export_pdfbook&book_title=Test

Does that work?

Does the plugin now work for you?

Edit: I cannot reproduce this behavior sofar.

It works with a tips because if i clean the cookies in browser and after i
add a page, don't work.

But if i clean cookies in browser and after i add a page and immediatly i
press the erase button selection it work.

The problemi is that the cookie pagelist is initiated only when you press
erase selection, if you can't do it before other action, the cookie remaim
empty.

You understand now?
Sorry for my english.

Paolo.
Il 11/ago/2015 22:27, "Gerrit Uitslag" notifications@github.com ha
scritto:

Does the plugin now work for you?


Reply to this email directly or view it on GitHub
#61 (comment)
.

Nice observations! I have now something to try!

With erase button you mean the button that is mentioned 'Clear selection' in this screenshot?
http://img37.imageshack.us/img37/2496/bookcreatorbookmanager.png

Yes, yesterday with this action (press clear section button) the
list-pagelist cookie had content inside.

2015-08-12 9:05 GMT+02:00 Gerrit Uitslag notifications@github.com:

Nice observations! I have now something to try!

With erase button you mean the button that is mentioned 'Clear selection'
in this screenshot?
http://img37.imageshack.us/img37/2496/bookcreatorbookmanager.png


Reply to this email directly or view it on GitHub
#61 (comment)
.

Hi,

just another question, where you set the initiation of cookie
list-pagelist?
ok the code is in script.js but when call the js?

Thanks.

Paolo .

2015-08-12 9:08 GMT+02:00 paolo pezzotta ppex76@gmail.com:

Yes, yesterday with this action (press clear section button) the
list-pagelist cookie had content inside.

2015-08-12 9:05 GMT+02:00 Gerrit Uitslag notifications@github.com:

Nice observations! I have now something to try!

With erase button you mean the button that is mentioned 'Clear selection'
in this screenshot?
http://img37.imageshack.us/img37/2496/bookcreatorbookmanager.png


Reply to this email directly or view it on GitHub
#61 (comment)
.

In the javascript script.js it is set in the storePageOrder function, which is called several times in the javascript. There it called by some event handler when clicking and sorting (e.g. here: https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/script.js#L197 )

In the PHP code it is read in syntax.php in the function exportOnScreen and function saveSelection()

In action.php the readsavedselection sets only the bookcreator['pageid'] array, not a list-pagelist cookie.

Ok, but it's called also from the page with button on the right?

see image below:

desk_doku

2015-08-12 11:19 GMT+02:00 Gerrit Uitslag notifications@github.com:

In the javascript script.js it is set in the storePageOrder function,
which is called several times in the javascript. There it called by some
event handler when clicking and sorting (e.g. here:
https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/script.js#L197
)

In the PHP code it is read in syntax.php in the function exportOnScreen
and function saveSelection()

In action.php the readsavedselection sets only the bookcreator['pageid']
array, not a list-pagelist cookie.


Reply to this email directly or view it on GitHub
#61 (comment)
.

https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/script.js#L10
This is triggered if the button in toolbar at top of the page are used. Here the list-pagelist should be set.

The button on the right triggers this: https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/action.php#L85
But that does only set a bookcreator['pageid'] cookie, no list-pagelist cookie.

OK! this is the problem i think.....why the right button doesn't set it?

2015-08-12 12:30 GMT+02:00 Gerrit Uitslag notifications@github.com:

https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/script.js#L10
This is triggered if the button in toolbar at top of the page are used.
Here the list-pagelist should be set.

The button on the right triggers this:
https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/action.php#L85
But that does only set a bookcreator['pageid'] cookie, no list-pagelist
cookie.


Reply to this email directly or view it on GitHub
#61 (comment)
.

I've tried with press button on top, and this is the problem, because my
dokuwiki installation, as you can show, when move the mouse over button on
top (see image below), the do nothing.

When i move the mouse over the button see on the foot-left page
error_dkw2

2015-08-12 12:33 GMT+02:00 paolo pezzotta ppex76@gmail.com:

OK! this is the problem i think.....why the right button doesn't set it?

2015-08-12 12:30 GMT+02:00 Gerrit Uitslag notifications@github.com:

https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/script.js#L10
This is triggered if the button in toolbar at top of the page are used.
Here the list-pagelist should be set.

The button on the right triggers this:
https://github.com/Klap-in/dokuwiki-plugin-bookcreator/blob/master/action.php#L85
But that does only set a bookcreator['pageid'] cookie, no list-pagelist
cookie.


Reply to this email directly or view it on GitHub
#61 (comment)
.

The images are not visible for me. You have to drag them into github at github.com itself.

Normally it is not a problem, because the bookmanager will run the javascript funtion storePageOrder() . But probably sometimes not...

I will also add setting the list-pagelist cookie by the button on the right hand side.

I've updated the images that you can't show via email.

The (+) link at the top is an button with only a javascript event. The button on the right is real link, that reloads the page.

I'm started last week with preparing some changes in when the list-pagelist cookie is set. I will try to publish this week some code that you could test.

Hi Klap some code to test?

Is there any news on this bug?

I have exactly the same problem:

  • adding a page with the top link does nothing.
  • adding a page with the right button works, but when I try to export it then, it just says "You don't have pages selected yet".
  • I checked the cookies and for me still only a bookcreator cookie is created (by the right button), but no list-pagelist. I have no idea when this list-pagelist cookie should be created as I cannot use the top link to add a page (as I wrote it just does nothing)...

I really would like to use this plug-in, but I don't get it to work.
Looking forward to any tip on that!

Thanks
Andreas

I stopped working on this cookie stuff.
Instead I'm now developing an alternative approach with localStorage.
That should solve also issues with limited possible number of selected pages.
Because I'm doing that in free time the progress is a bit slow...

OK, I see, that's a pity.

I will then remove this plug-in for now as its really not working at all and use the "good old" include method to build a PDF of the whole wiki...

Thanks anyway
Andreas

work-in-progress is visible at: #72

In pull request #72 the selection mechanism of the bookcreator plugin is replaced. It needs an updated dw2pdf plugin as well.

In that pull request I have used the localStorage of the browser for storing the current selection in stead of cookies. It should allow for selecting more pages, probably the limit is now the timeout limit of the webserver while generating the pdffile. Hopefully this issue will be solved now as well!

Any feedback is welcome!

The backend of this plugin is not based at cookies but on localStorage.
You can obtain this by updating the bookcreator plugin+dw2pdf plugin
So these issues should not happen anymore.