pluginsGLPI / order

Order plugin for GLPI
GNU General Public License v3.0
39 stars 44 forks source link

vendor/masnathan/odtphp deprecation warnings with php 8.3 #385

Open jeffallen opened 1 month ago

jeffallen commented 1 month ago

When I try to generate a PO, I get these warnings:

 Deprecated: Function utf8_encode() is deprecated in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/Odf.php on line 112

Deprecated: Return type of Odtphp\Segment::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/Segment.php on line 87

Deprecated: Return type of Odtphp\Segment::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/Segment.php on line 77

Deprecated: Return type of Odtphp\SegmentIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 31

Deprecated: Return type of Odtphp\SegmentIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 41

Deprecated: Return type of Odtphp\SegmentIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 36

Deprecated: Return type of Odtphp\SegmentIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 61

Deprecated: Return type of Odtphp\SegmentIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 46

Deprecated: Return type of Odtphp\SegmentIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 51

Deprecated: Return type of Odtphp\SegmentIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 56

Deprecated: Creation of dynamic property Odtphp\SegmentIterator::$keys is deprecated in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/SegmentIterator.php on line 28

Deprecated: Function utf8_encode() is deprecated in /var/www/glpi/plugins/order/vendor/masnathan/odtphp/src/Odf.php on line 112

This comes from https://github.com/TECLIB/odtphp apparently.

jeffallen commented 1 month ago

I was able to solve this problem by adding display_errors=off in my php.ini, but that's a sledgehammer.

I would prefer to see https://github.com/TECLIB/odtphp get fixed.

trasher commented 3 weeks ago

I would prefer to see https://github.com/TECLIB/odtphp get fixed.

Unfortunately, original lib is not maintained for years, I do not think we will fix this fork. The best solution would be to replace that lib with another one that is still supported (phpspreadshirt has been included as part of GLPI 11, it's certainly the best option).

Adapting whole PHP configuration for such issues is most of the time not a good solution (but that's up to you).

jeffallen commented 3 weeks ago

OK, understood that this is fixed in GLPI 11.

Where can I find out more about GLPI 11 and follow it's schedule and release?

trasher commented 3 weeks ago

This is not fixed in GLPI 11.

I just mean there is already another ODT export lib included, so plugin should use the same.