Getting The below Error when Theme is Enabled

Notice: Undefined offset: 0 in business_preprocess_page() (line 47 of themes/business/business.theme).
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 265 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

Comments

mevaibhav created an issue. See original summary.

sakthivel m’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

#2 Please review the patch

sakthivel m’s picture

StatusFileSize
new570 bytes

#3 Please review the patch

gurubaskar’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new115.31 KB
new71.1 KB

I have reviewed the patch #3. Its working fine as per expectation.

Before
befor patch

After
After patch

iVaibhav’s picture

Thank You Guys !!!!

gauravvvv’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs reroll, Patch doesn't apply anymore to D8.1

Osls-Air:business osl$ git apply -v Warning-array-flip-2-3071281.patch
Checking patch business.theme...
error: while searching for:
    $vars['slider'] = array();
    for ($i = 1; $i <= SLIDESHOW_COUNT; $i++) {
      $fid = theme_get_setting("slide_image_{$i}", "business");
      $file = \Drupal\file\Entity\File::load($fid[0]);
      if (!empty($file)) {
        $uri = $file->getFileUri();
        $image_path = file_create_url($uri);

error: patch failed: business.theme:44
error: business.theme: patch does not apply
ankithashetty’s picture

Changes made in #3 has already been fixed in issue #3224536: Errors messages in drupal 9.2 . Found a similar patch in issue #2937632: business theme installation(D8).

gauravvvv’s picture

Status: Needs work » Closed (duplicate)

Closing this as duplicate.