Database exporter fix for php 8.1 deprecations#264
Database exporter fix for php 8.1 deprecations#264alikon wants to merge 1 commit intojoomla-framework:2.0-devfrom
Conversation
|
Question is what will happen if we apply the fix and run an export and the import the exported file again? Will the import work and apply null values where necessary where we now will have empty strings with the fix? |
|
Whether you print null or an empty string does not make a difference. In both cases, the result will be |
|
We may need to differentiate though as those are different things in e.g. postgres |
Not in this case - it is about |
|
@mbabker or @nibra what is the way forward here, I see more Anyway any more feedback here will help, thanks! |
|
In this case, the patch is ok and doing it's job. |
|
No, it's not. As George already pointed out, there is a huge difference between a database column storing a null value versus an empty string, and this patch makes it impossible to distinguish the two in an exported dataset. |
|
Although you're right that NULL should be handled differently, does this patch not change the behaviour. The exporter has always delivered an empty string for NULL values. |
|
I've created an alternative PR which properly handles NULL values: #286 |
|
closing in favour of #264 |
Summary of Changes
used null coalescing operator
Testing Instructions
with Error Reporting setted to Maximum
run
php cli/joomla.php database:export --folder=tmp/you got a lot of
PHP Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /shared/httpd/test/zzzz/libraries/vendor/joomla/database/src/DatabaseExporter.php on line 305