-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some fixes to support php 8.? #43
base: master
Are you sure you want to change the base?
Conversation
Before the deprecation log had this message: require_once() is deprecated
Before the missing "url" key led to the following error messages: 2024-09-06 11:20:05 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(337) E_WARNING: Undefined array key "url" 0 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(337): dokuwiki\ErrorHandler::errorHandler(2, 'Undefined array...', '/var/www/html/d...', 337) 1 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(271): renderer_plugin_epub->local_name(Array, '') 2 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(145): renderer_plugin_epub->_formatLink(Array) 3 /var/www/html/dokuwiki/inc/parser/xhtml.php(1891): renderer_plugin_epub->_media('Video/felix_rec...', 'felix_recording...', 'center', NULL, NULL, 'cache', true) 4 /var/www/html/dokuwiki/inc/parser/xhtml.php(1203): Doku_Renderer_xhtml->_getMediaLinkConf('felix:recording...', '', 'center', NULL, NULL, 'cache', true) 5 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(56): Doku_Renderer_xhtml->internalmedia('felix:recording...', '', 'center', NULL, NULL, 'cache', 'details') 6 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(187): epub_creator->create(':felix:exploiti...') 7 {main} 2024-09-06 11:20:05 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(340) E_WARNING: Undefined array key "url" 0 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(340): dokuwiki\ErrorHandler::errorHandler(2, 'Undefined array...', '/var/www/html/d...', 340) 1 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(271): renderer_plugin_epub->local_name(Array, '') 2 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(145): renderer_plugin_epub->_formatLink(Array) 3 /var/www/html/dokuwiki/inc/parser/xhtml.php(1891): renderer_plugin_epub->_media('Video/felix_rec...', 'felix_recording...', 'center', NULL, NULL, 'cache', true) 4 /var/www/html/dokuwiki/inc/parser/xhtml.php(1203): Doku_Renderer_xhtml->_getMediaLinkConf('felix:recording...', '', 'center', NULL, NULL, 'cache', true) 5 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(56): Doku_Renderer_xhtml->internalmedia('felix:recording...', '', 'center', NULL, NULL, 'cache', 'details') 6 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(187): epub_creator->create(':felix:exploiti...') 7 {main} 2024-09-06 11:20:05 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(312) E_WARNING: Undefined array key "url" 0 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(312): dokuwiki\ErrorHandler::errorHandler(2, 'Undefined array...', '/var/www/html/d...', 312) 1 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(285): renderer_plugin_epub->set_footnote(Array, 'https://...') 2 /var/www/html/dokuwiki/lib/plugins/epub/renderer.php(145): renderer_plugin_epub->_formatLink(Array) 3 /var/www/html/dokuwiki/inc/parser/xhtml.php(1891): renderer_plugin_epub->_media('Video/felix_rec...', 'felix_recording...', 'center', NULL, NULL, 'cache', true) 4 /var/www/html/dokuwiki/inc/parser/xhtml.php(1203): Doku_Renderer_xhtml->_getMediaLinkConf('felix:recording...', '', 'center', NULL, NULL, 'cache', true) 5 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(56): Doku_Renderer_xhtml->internalmedia('felix:recording...', '', 'center', NULL, NULL, 'cache', 'details') 6 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(187): epub_creator->create(':felix:exploiti...') 7 {main}
list($vara,$varb) receives an array that it assignes to the variables. If it's too few it's a problem. Now array_pad expands the array if it hasn't enough members with empty strings to the correct size: list($file,$rest) = array_pad(explode('|',$file), 2, '');
Before if haystack was an empty string the type error was produced when looking for '*'. Now with the size check it handles correctly, that in empty string is no '*'
Before this error was produced: 2024-09-06 10:28:31 /var/www/html/dokuwiki/lib/plugins/epub/scripts/epub_utils.php(53) E_WARNING: Undefined variable $cover_png #0 /var/www/html/dokuwiki/lib/plugins/epub/scripts/epub_utils.php(53): dokuwiki\ErrorHandler::errorHandler(2, 'Undefined varia...', '/var/www/html/d...', 53) turnermm#1 /var/www/html/dokuwiki/lib/plugins/epub/scripts/ebook.php(169): epub_opf_header(true) turnermm#2 {main} Now cover_png is simply declared empty.
I am no longer developing for Dokuwiki. Too old. But you are welcome to adopt epub, if you feel you are able to. Or in partnership with someone. You might find someone by asking on the forum.
Best wishes,
Myron Turner
…----- Original Message -----
From: Felix Bauer ***@***.***>
To: turnermm/epub ***@***.***>
Cc: Subscribed ***@***.***>
Sent: Mon, 09 Sep 2024 02:05:48 -0600 (MDT)
Subject: [turnermm/epub] Some fixes to support php 8.? (PR #43)
Hey.
It seems to work and generates readable epubs. If I did well I don't know.
I might update this with more fixes in the future and I am happy to make changes, so please comment.
I am not a php developer!!
I just hope this can be useful.
For now I run and test with php 8.2
You can view, comment on, or merge this pull request online at:
#43
-- Commit Summary --
* Possible fix for issue #37
* Change imports from Dokuwiki to new syntax
* Add "url" key to arrays created on the fly
* Fix Undefined array key
* Fix a strange Error that has to do with user styles
* Fix Error Illegal offset type
* Fix Warning when cover_png is undefined
-- File Changes --
M action.php (14)
M plugin.info.txt (2)
M renderer.php (10)
M scripts/css2.php (19)
M scripts/epub_utils.php (6)
M syntax.php (11)
M version (2)
-- Patch Links --
https://github.com/turnermm/epub/pull/43.patch
https://github.com/turnermm/epub/pull/43.diff
--
Reply to this email directly or view it on GitHub:
#43
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Wow. Thank you. The forum you are referring to is https://forum.dokuwiki.org/t/plugins I would just leave it like it is for now and see how things evolve. I would even write a paragraph here to let people know: |
Yes, as to the forum address. And your plan for going forward sounds good, but you can update the current plugin page for epub with a notification that a PHP 8 compatible version is available, giving the link to your update.
.All the best,
Myron Turner
From: "Felix Bauer" ***@***.***>
To: "turnermm" ***@***.***>
Cc: "Myron Turner" ***@***.***>, "Comment" ***@***.***>
Sent: Wednesday, September 11, 2024 6:35:37 AM
Subject: Re: [turnermm/epub] Some fixes to support php 8.? (PR #43)
Wow. Thank you.
For now I will just use it the way it is, if that is ok for you.
I don't even know if epub plugin is still used by a lot of people.
The forum you are referring to is [ https://forum.dokuwiki.org/t/plugins | https://forum.dokuwiki.org/t/plugins ]
correct?
I would just leave it like it is for now and see how things evolve.
People can clone my branch and use the plugin the same way I do.
Is that ok for you?
I would even write a paragraph here to let people know:
[ https://www.dokuwiki.org/plugin:epub | https://www.dokuwiki.org/plugin:epub ]
—
Reply to this email directly, [ #43 (comment) | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AABLCP5KRRUQGWOQ3RAVURLZWATITAVCNFSM6AAAAABN36Y77GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBTGQYDCOBYG4 | unsubscribe ] .
You are receiving this because you commented. Message ID: ***@***.***>
|
Hey.
It seems to work and generates readable epubs. If I did well I don't know.
I might update this with more fixes in the future and I am happy to make changes, so please comment.
I am not a php developer!!
I just hope this can be useful.
For now I run and test with php 8.2