Hello,
This commit reimplements some PHP 8 fixes removed in #290 and fixes new issues. Now it's possible to export pages to ODT without any PHP 8 warning (on my tests) even with display_errors set to On.
Most of the removed fixes in #290 was mine because I wrongly fix some issues into the wrong way. Most of DokuWiki PHP 8+ issues is fixed using "isset", but I had to study ODT plugin further to make it right.
Some of the fixes on this PR are:
Fix ODT Frame rendering PHP8 Warnings. Wrap plug-in render correctly if $elementObj isn't set and without set position, background-image and pic_positions params (Wrap plug-in do not set them), and they are not being used on ODT 2019-07-27 version too, so it's safe to assume null values for them.
Linebreaks wasn't being rendered so codeblocks was being rendered in-line. My fix on #283 break it. Now it's working as it should.
Fix CSS import rendering. Some elements (like Wrap plugin) wasn't set background-color and other CSS properties on exported ODT file because I misunderstood how this import works on my fix #283. I reverted those changes in #290 and now it's working as it should on PHP 8 without warnings.
Max width calculation was failling on Table elements. The "ternite" user attempt to fix this using is_numeric verification but it was failing and the Wrap plug-in table wasn't being shown because the max_width variable receives a value with pt suffix on it, so to avoid division by zero or non-numeric value warnings was necessary to remove the pt suffix from it.
Fix Paragraph <style> tag rendering on content.xml ODT file by fixing ODTParagraphStyle.php and ODTStyle.php files. My fix on #283 was doing the wrong assumption about the logic on ODTParagraphStyle.php file and no custom styles was being applied for paragraphs. The consequence of this was the misalignment of Wrap elements (it wasn't being centered) because it's CSS properties wasn't being applied.
When exporting Wrap plug-in boxes it seems to append px to the unit so it was throwing a PHP 8 warning of non-numeric value because ODTUnit expects values without px prefix so I trim it from the value if it's there.
Hello, This commit reimplements some PHP 8 fixes removed in #290 and fixes new issues. Now it's possible to export pages to ODT without any PHP 8 warning (on my tests) even with
display_errors
set toOn
. Most of the removed fixes in #290 was mine because I wrongly fix some issues into the wrong way. Most of DokuWiki PHP 8+ issues is fixed using "isset", but I had to study ODT plugin further to make it right.Some of the fixes on this PR are:
$elementObj
isn't set and without setposition
,background-image
andpic_positions
params (Wrap plug-in do not set them), and they are not being used on ODT 2019-07-27 version too, so it's safe to assume null values for them.background-color
and other CSS properties on exported ODT file because I misunderstood how this import works on my fix #283. I reverted those changes in #290 and now it's working as it should on PHP 8 without warnings.is_numeric
verification but it was failing and the Wrap plug-in table wasn't being shown because themax_width
variable receives a value withpt
suffix on it, so to avoid division by zero or non-numeric value warnings was necessary to remove thept
suffix from it.<style>
tag rendering oncontent.xml
ODT file by fixingODTParagraphStyle.php
andODTStyle.php
files. My fix on #283 was doing the wrong assumption about the logic onODTParagraphStyle.php
file and no custom styles was being applied for paragraphs. The consequence of this was the misalignment of Wrap elements (it wasn't being centered) because it's CSS properties wasn't being applied.px
to the unit so it was throwing a PHP 8 warning ofnon-numeric value
because ODTUnit expects values withoutpx
prefix so I trim it from the value if it's there.