I have a custom module that registers some layouts with layout discovery, using icon_map to generate icons:

layout_panes_3c:
  label: '3 Panes C'
  path: layouts/panes_3c
  template: layout--panes-3c
  library: panes_3c
  category: 'Panes: 3'
  default_region: main
  icon_map:
    - [main]
    - [left, right]
  regions:
    main:
      label: 'Main content'
    left:
      label: 'Bottom left'
    right:
      label: 'Bottom right'

Without Panels installed, this works as intended, displaying the generated svg icon just as the layouts provided with layout_discovery do. With Panels installed, the layout_discovery layouts show the image icons provided with Panels, and my custom layouts show the "no preview icon" image.

I'm uncertain as to whether Panels and Layout Discovery are intended to be used together.

CommentFileSizeAuthor
#2 2999112-2-preserve-icon-map.patch672 byteswrd

Comments

wrd created an issue. See original summary.

wrd’s picture

StatusFileSize
new672 bytes

This appears to do the trick -- it simply checks to see if getIconMap() exists and returns a non-empty value, and if so, does nothing, preventing the "no preview" icon from replacing the icon_map generated SVG. This assumes, though, that the SVG should have precedence if both it and an icon are defined.

wrd’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 2999112-2-preserve-icon-map.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

develissimo’s picture

Same issue here on Drupal 8.6.1 except that the provided patch does not solve the issue.
Layout-Icons via icon_map: ... are not generated. Instead the "no-layout-preview.png" image is shown.

zyyz’s picture

Seems to be a duplicate of https://www.drupal.org/project/panels/issues/3030976.
The patch on that issue, https://www.drupal.org/files/issues/2019-02-06/initial.patch, seems to work fine.

zyyz’s picture

Status: Needs work » Closed (duplicate)