Skip to content

Conversation

@daniloargentiero
Copy link

No description provided.

@mhauri
Copy link

mhauri commented Sep 6, 2018

Hi @DaniloEmpire can you please provide a proper description for your Pull Request?

@Amadeco
Copy link
Contributor

Amadeco commented Jan 17, 2019

Good afternoon,

This pull request is a mandatory to work on Magento 2.3 (it seems to work on earlier versions).

This what we meet on error logs :

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Magento\Cms\Helper\Wysiwyg\Images::getImageHtmlDeclaration(), 0 passed in /vendor/magento/framework/Interception/Interceptor.php on line 58 and at least 1 expected in /vendor/magento/module-cms/Helper/Wysiwyg/Images.php:200

In the Magento doc :

Before the list of the original method’s arguments, around methods receive a callable that will allow a call to the next method in the chain. When the callable is called, the next plugin or the observed function is called.

When you wrap a method which accepts arguments, **your plugin must also accept those arguments** and you must forward them when you invoke the proceed callable.

http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html#defining-a-plugin

As a note, Magento's docs said you can also use variadics like
function (...$args)
$proceed(...$args)
when you do not use parameters.

Ilan PARMENTIER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants