selfthinker / dokuwiki_plugin_wrap

Wrap Plugin for DokuWiki: Universal plugin which combines functionalities of many other plugins. Wrap wiki text inside containers (divs or spans) and give them a class (choose from a variety of preset classes), a width and/or a language with its associated text direction.
http://www.dokuwiki.org/plugin:wrap
GNU General Public License v2.0
41 stars 33 forks source link

Fix issue #272: PHP 8+ warnings, "undefined array key", margins #275

Closed nerun closed 9 months ago

nerun commented 9 months ago

An alternative fix for issue #272, since PR #274 Fix ODT exporting tables do not pass the tests. Crossing fingers...

I am using this fix since 22 sep 2023 and no issues.

nerun commented 9 months ago

Failed in the exactly same tests than #274.

eduardomozart commented 9 months ago

The ending results will be exactly as PR #274 because the margin values will be override to "0cm" since line 709 ( https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/master/helper.php#L709 ) check's if float is null and set the margin values to '0cm'. Let's wait Klap-in (I'll not mark him as he is occupied) review our code changes and he chooses the one that will be commited to the code. Thank you for your code contribution.

nerun commented 9 months ago

Thanks for trying friend!

eduardomozart commented 9 months ago

The ODT XML specification requires to specify the unit ('cm', etc.). Try avoid focusing in those auto PHP tests. I believe they are broken, maybe some required file is missing for them.

Klap-in commented 9 months ago

Hi, thanks for the proposals. I have not the time dive in the odt part, so may I ask you both to conclude on this topic what is the best. If following the odt specification is better then #274 is the way, otherwise #275? If it is tested, I can merge the preferred PR.

If unit tests are incorrect, is it possible to fix them?

eduardomozart commented 9 months ago

Hello @Klap-in, My PR seems to be less disruptive because it keeps the defaults value (0cm) for margin as expected from ODT XHTML specs, and I already worked on ODT plugin to migrate it to PHP 8, but both commit are good and will have the same results. About the tests: it seems broken on Master because @splitbrain replaced the legacy PHPUnit tests on the master branch at Sep 18, 2023 (https://github.com/dokuwiki/dokuwiki/commits/master/_test) to use composer (actually, the Wrap plugin still require the file "fetchphpunit" file): https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/9c6c948e33d880fdf9583545439af9e3c1fabae4/.github/workflows/phpTestLinux.yml#L44), but I'm not sure how to migrate Wrap tests to use it.

Klap-in commented 9 months ago

I will see if I can add the new test setup with the dev plugin.

nerun commented 9 months ago

275 was tested for one month without issues, but I DO BELIEVE #274 will work the same way. It's up to you.