This is the error in the chrome console.

Uncaught AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /entity-embed/dialog/entity-embed/html_editor/node
StatusText: Internal Server Error
ResponseText: {"message":"A fatal error occurred: Callable \u0022Drupal\\entity_embed\\Form\\EntityEmbedDialog::buttonIsEnabled\u0022 requires a value for the \u0022$embed_button\u0022 argument."}

AFAICS, it is a regression introduced in https://github.com/drupal-media/entity_embed/commit/af647a587de4358eebf4...

For some reason, in this path: '/entity-embed/dialog/entity-embed/{filter_format}/{entity_embed_button}'

{entity_embed_button} is not resolved to the config object.

CommentFileSizeAuthor
#5 2548987-fix-routes.patch2.05 KBdave reid

Comments

jonhattan created an issue. See original summary.

dave reid’s picture

Does it happen after a rebuild?

dave reid’s picture

Huh, strange.

dave reid’s picture

For some reason the parameter is getting lost in the Route:

Symfony\Component\Routing\Route Object
(
    [path:Symfony\Component\Routing\Route:private] => /entity-embed/dialog/entity-embed/{filter_format}/{entity_embed_button}
    [host:Symfony\Component\Routing\Route:private] => 
    [schemes:Symfony\Component\Routing\Route:private] => Array
        (
        )

    [methods:Symfony\Component\Routing\Route:private] => Array
        (
            [0] => GET
            [1] => POST
        )

    [defaults:Symfony\Component\Routing\Route:private] => Array
        (
            [_form] => \Drupal\entity_embed\Form\EntityEmbedDialog
            [_title] => Embed entity
        )

    [requirements:Symfony\Component\Routing\Route:private] => Array
        (
            [_entity_access] => filter_format.use
            [_custom_access] => \Drupal\entity_embed\Form\EntityEmbedDialog::buttonIsEnabled
            [_method] => GET|POST
        )

    [options:Symfony\Component\Routing\Route:private] => Array
        (
            [compiler_class] => \Drupal\Core\Routing\RouteCompiler
            [parameters] => Array
                (
                    [filter_format] => Array
                        (
                            [type] => entity:filter_format
                            [converter] => paramconverter.entity
                        )

                )

            [_route_filters] => Array
                (
                    [0] => content_type_header_matcher
                )

            [_route_enhancers] => Array
                (
                    [0] => route_enhancer.param_conversion
                )

            [_access_checks] => Array
                (
                    [0] => access_check.entity
                    [1] => access_check.custom
                )

        )

    [compiled:Symfony\Component\Routing\Route:private] => Drupal\Core\Routing\CompiledRoute Object
        (
            [fit:protected] => 28
            [patternOutline:protected] => /entity-embed/dialog/entity-embed/%/%
            [numParts:protected] => 5
            [variables:Symfony\Component\Routing\CompiledRoute:private] => Array
                (
                    [0] => filter_format
                    [1] => entity_embed_button
                )

            [tokens:Symfony\Component\Routing\CompiledRoute:private] => Array
                (
                    [0] => Array
                        (
                            [0] => variable
                            [1] => /
                            [2] => [^/]++
                            [3] => entity_embed_button
                        )

                    [1] => Array
                        (
                            [0] => variable
                            [1] => /
                            [2] => [^/]++
                            [3] => filter_format
                        )

                    [2] => Array
                        (
                            [0] => text
                            [1] => /entity-embed/dialog/entity-embed
                        )

                )

            [staticPrefix:Symfony\Component\Routing\CompiledRoute:private] => /entity-embed/dialog/entity-embed
            [regex:Symfony\Component\Routing\CompiledRoute:private] => #^/entity\-embed/dialog/entity\-embed/(?P[^/]++)/(?P[^/]++)$#s
            [pathVariables:Symfony\Component\Routing\CompiledRoute:private] => Array
                (
                    [0] => filter_format
                    [1] => entity_embed_button
                )

            [hostVariables:Symfony\Component\Routing\CompiledRoute:private] => Array
                (
                )

            [hostRegex:Symfony\Component\Routing\CompiledRoute:private] => 
            [hostTokens:Symfony\Component\Routing\CompiledRoute:private] => Array
                (
                )

        )

    [condition:Symfony\Component\Routing\Route:private] => 
)
dave reid’s picture

Status: Active » Needs review
StatusFileSize
new2.05 KB

Ok, I forgot Drupal is "smart" and actually inspects the function parameters. So we didn't rename all the function parameters properly.

dave reid’s picture

Confirmed this resolves the issue for me.

dave reid’s picture

Status: Needs review » Fixed

Committed #5 to 8.x-1.x.

dave reid’s picture

Status: Fixed » Needs work

Also, obviously show we lack some test coverage.

  • Dave Reid committed ddaef97 on 8.x-1.x
    Issue #2548987 by Dave Reid: Fixed $entity_embed parameter not renamed...
dave reid’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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