0
votes

I have this error (Warning: Illegal string offset 'name' in Drupal\bootstrap\Plugin\Provider\DrupalBootstrapStyles->Drupal\bootstrap\Plugin\Provider{closure}() (line 71 of themes\bootstrap\src\Plugin\Provider\DrupalBootstrapStyles.php).) when I open a web page of my site. If anyone have an idea how to solve that. I use a child theme from ( bootstrap 3 for drupal) Link Image of the error:

https://drive.google.com/file/d/1An9ZDdhDKibK5UnOfvOl821sKd0MdPFP/view

2
Generally, this error means you're doing something like $test = 'some string'; then something like $name = $test['name'] essentially, whatever variable you're working with is expected to be an array and it is not. Check the data you're feeding to that class - Wesley Smith
@WesleySmith Yeah, but Im using Drupal 8, I'm not touching any of source code. I dont know what I should do exactly. looking for the bootstrap theme ? or updating core ? or what exactly - Youssef HRIZI
Id start by looking at line 71 of themes\bootstrap\src\Plugin\Provider\DrupalBootstrapStyles.php, figuring out what exactly its trying to get a "name" index from and follow it back from there. Id guess that its some kind of missing configuration or something not being set correctly when setting up the view or model or whatever powers the page/app. - Wesley Smith
drupal-bootstrap.org/api/bootstrap/… shows that line 71 is looping over $data['files'] and trying to get $file['name'], perhaps somewhere in your configuration theres an array of string file names that should be an array of arrays? follow that back to where $data['files'] comes from - Wesley Smith
@WesleySmith Im using a field type Image (Unlimited). I will check that - Youssef HRIZI

2 Answers

1
votes

also seeing this in one of our environments, there is a workaround (disable the cdn setting and another step)

see the explanation and issue thread below https://www.drupal.org/project/bootstrap/issues/3113579

0
votes

I am also getting this, but its happening in IIS only. On my XAMPP server its fine. Anyone else using IIS?

Also, there should be a fallback option if I am running this on development servers that can't access the internet. Seems like there is an external call to the Cdn from the php code to load the Bootstrap styles...