Bug #12942

AtoM CSV import not working under PHP 7.1 and later

Added by Steve Breker about 1 month ago. Updated about 1 month ago.

Status:VerifiedStart date:04/04/2019
Priority:HighDue date:
Assignee:Michelle Curran% Done:

0%

Category:CSV import
Target version:Release 2.5.0
Google Code Legacy ID: Tested version:
Sponsored:No Requires documentation:

Description

CSV import is not working under PHP 7.1 or higher. The error is:

PHP message: PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function QubitFlatfileExport::loadResourceConfigFile(), 1 passed in /usr/share/nginx/atom/apps/qubit/modules/object/actions/importSelectAction.class.php on line 263 and exactly 2 expected in /usr/share/nginx/atom/lib/flatfile/QubitFlatfileExport.class.php:155

This is due to a breaking change introduced in PHP 7.1 where "a warning would be emitted for invoking user-defined functions with too few arguments. Now, this warning has been promoted to an Error exception. This change only applies to user-defined functions, not internal functions."

See:
https://www.php.net/manual/en/migration71.incompatible.php#migration71.incompatible.too-few-arguments-exception

This is occurring in the code were this method is being called with one param:
https://github.com/artefactual/atom/blame/ee3645b4f8f8d867cf9f30c7083d08b6aab2e35d/apps/qubit/modules/object/actions/importSelectAction.class.php#L263

And the method definition is expecting two:
https://github.com/artefactual/atom/blame/ee3645b4f8f8d867cf9f30c7083d08b6aab2e35d/lib/flatfile/QubitFlatfileExport.class.php#L155

History

#2 Updated by Steve Breker about 1 month ago

Variable number of parameters to functions in PHP >= 5.6

https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list

#3 Updated by Mike Cantelon about 1 month ago

  • Assignee set to Mike Cantelon

#4 Updated by Mike Cantelon about 1 month ago

  • Status changed from New to Code Review
  • Assignee deleted (Mike Cantelon)

#5 Updated by Steve Breker about 1 month ago

  • Status changed from Code Review to Feedback

CR looks good!

#6 Updated by Mike Cantelon about 1 month ago

  • Status changed from Feedback to QA/Review

Thanks Steve!

#7 Updated by Michelle Curran about 1 month ago

  • Assignee set to Michelle Curran

#8 Updated by Michelle Curran about 1 month ago

  • Status changed from QA/Review to Verified

Verified - Ran a number of CSV import tasks, and they check out OK. Running into probs with SQL datetime conditions but we're already aware of that separate issue.

Also available in: Atom PDF