Problem/Motivation

Under some special circumstances (probably when there is no bundle) I get:

Notice: Undefined index: $bundle in Drupal\eva\Plugin\views\display\Eva->optionsSummary() (line 133 of modules/contrib/eva/src/Plugin/views/display/Eva.php).

error_img

CommentFileSizeAuthor
Screenshot from 2022-04-20 09-58-20.png207.35 KBlosewn

Issue fork eva-3276152

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

losewn created an issue. See original summary.

ahebrank’s picture

I think $bundle_names probably still needs to get something for each bundle. Maybe like this?

foreach ($this->getOption('bundles') as $bundle) {
  $bundle_names[] = $bundle_info[$bundle]['label'] ?? '(unknown bundle)';
}

I'm a little worried that this is a bigger issue and we should be getting bundle info a different way if 'label' in this array is undefined. Can you post the contents of $bundle_info[$bundle] for your site?

ahebrank’s picture

Status: Fixed » Needs work

vitaliyb98 made their first commit to this issue’s fork.

vitaliyb98’s picture

Version: 8.x-2.x-dev » 3.1.x-dev

vitaliyb98’s picture

Status: Needs work » Needs review

Added new branch '3276152-missing-bundle' for 3.1.x

vitaliyb98’s picture

In branch 3276152-missing-bundle, added the solution suggested by @ahebrank and covered it with a test.

Will be good if someone could review my changes.

terry_kolodiy’s picture

Assigned: losewn » Unassigned
Status: Needs review » Reviewed & tested by the community
Issue tags: +LutskGCW26

Hi. I've tested this solution with no-bundle entities: it works fine and applies 'Unknown bundle'.
So, I think the fix can be merged

Thanks for your fix

vitaliyb98’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 3.1.x, thanks for the review.

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.

Status: Fixed » Closed (fixed)

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