Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
27 Nov 2026

Pull Request for Issue # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

This change was created with the help of AI (Claude Code).

Summary of Changes

weblinks:sync-csv --action=import (console plugin) combines each CSV row with the header via array_combine(). On PHP 8 array_combine() throws a ValueError when both arrays have a different number of elements; it no longer returns false. An empty line (which fgetcsv() returns as [null]), e.g. a trailing blank line, or a row with fewer/more columns therefore aborts the whole import with an uncaught exception, and the if (!$data) check is never reached.

Rows whose column count does not match the header are now skipped.

Testing Instructions

  • Export the weblinks with php cli/joomla.php weblinks:sync-csv --action=export --file=<file>.
  • Add an empty line in the middle of the CSV file and a line with only two columns.
  • Import the file with php cli/joomla.php weblinks:sync-csv --action=import --file=<file>.

Expected result

The import finishes; the invalid lines are skipped.

Actual result

ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements.

Documentation Changes Required

None

avatar Hackwar Hackwar - open - 27 Nov 2026
avatar Hackwar Hackwar - change - 27 Nov 2026
The description was changed
avatar Hackwar Hackwar - edited - 27 Nov 2026

Add a Comment

Login with GitHub to post a comment