Problem/Motivation

After update from 2.1.2 to 2.1.4, I am having this error in my website:

TypeError: Cannot assign null to property Drupal\ajax_loader\ThrobberPluginBase::$cssFile of type string in Drupal\ajax_loader\ThrobberPluginBase->__construct() (line 60 of modules/contrib/ajax_loader/src/ThrobberPluginBase.php).

The property cssFile only support string now, but it can accept a null value. According to ajax_loade.module

 if ($css_file = $throbber->getCssFile()) {
   $libraries['ajax_loader.throbber']['css']['theme'][$css_file] = [];
 }

Proposed resolution

Accept NULL when the property is defined

protected ?string $cssFile;

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dioni created an issue. See original summary.

dioni’s picture

Status: Active » Needs review
mvogel’s picture

Thank you :)
Looks good to me; I didn't test it, but the changes to the code should be fine.

mvogel’s picture

Assigned: dioni » Unassigned
Status: Needs review » Fixed

Released a new version 2.1.5

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

dioni’s picture

Thanks! :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.