Problem/Motivation
After updating the Flag module to 8.x-4.0-beta6, this module is not integrating with well with views. Pages displaying views with an indexed Search API flag field are throwing a fatal error:
Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "view_mode" for route "flag.action_link_unflag" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 209 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Could this be due to the change https://www.drupal.org/node/3458551?
Issue fork flag_search_api-3507901
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
Comment #4
joco_sp commentedEscalating to Critical, because it breaks the website.
Comment #5
jonraedeke commentedThank you for the quick fix Aljoša! It works well and diff looks good. RTBC
Comment #6
hatsch commentedconfirm that this fixes problems with Flag 8.x-4.0-beta6. RTBC
Comment #7
bsingh commentedThanks @joco_sp
Comment #8
liquidcms commentedI have this error without Flag Search API, so wonder if the fix should be here or in the Flag module?
Comment #9
liquidcms commentedNope, my bad. i have custom code (likely like this module does) that calls Flag link building service.. which they changed API for in beta6. "view mode" is no longer option parameter to pass. Still likely a bug in Flag as it has $view_mode = NULL in call to LinkBuilder method and it should likely be $view_mode = 'default'.