- Issue created by @morampudi.sowji
- First commit to issue fork.
Drupal.AjaxError
message
:
"\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/config/content/contentimport?ajax_form=1\nStatusText: parsererror\nResponseText: \nDeprecated: Creation of dynamic property Drupal\\contentimport\\Form\\ContentImport::$file is deprecated
in /var/www/html/docroot/modules/contrib/contentimport/src/Form/ContentImport.php on line 109\n[{\"command\":\"update_build_id\",\"old\":\"form-kkyoh-SPvCE5Cq1xwfjwm3KcrCelc0o26CEQrsFIe5k\",\"new\":\"form-MJXmDbHDHVh6wTGBHYxY6e8kWvMD8Et_RIYDgnQ-0lM\"},{\"command\":\"insert\",\"method\":\"html\",\"selector\":\"#content_import_field"
name
:
"AjaxError"
stack
Deprecated: Creation of dynamic property Drupal\contentimport\Form\ContentImport::$file is deprecated in ContentImport.php on line 108
This is a PHP 8.2+ deprecation. In newer PHP versions, creating dynamic properties (i.e., assigning a property that wasn't declared in the class) is no longer allowed by default.
Go to /admin/config/content/contentimport . You won;t be able to download sample csv file and also you would see the Error message -
"Oops, something went wrong. Check your browser's developer console for more details."
Declare the property explicitly
In ContentImport.php, find the ContentImport class and add this line near the top of the class:
protected $file;
Active
10.0
Code