0

Question

What do I need to setup a Button's behaviour, or is there CRUD built-in Magento 2 behaviour when I do not specify a Controller?

This is The tutorial article I am following.

I found the github The sample module that seems to be based on the tutorial.

This is The UI compontent config file I am basing my module on.

The relevant section on the 'Add New Post' button (name='add'):

<item name="add" xsi:type="array">
    <item name="name" xsi:type="string">add</item>
    <item name="label" xsi:type="string" translate="true">Add New Post</item>
    <item name="class" xsi:type="string">primary</item>
    <item name="url" xsi:type="string">*/*/new</item>
</item>

The target defined there is */*/new.

I have managed to get the grid working, it shows the InstallSchema/UpgradeSchema changes correctly in the database and in the admin area.

However, it feels like the tutorial isn't explaining everything here. The referenced */*/new resolves to admin/mymoduleroute/user/new

Are there built-in CRUD control handlers ? Like when I press 'New', it uses built-in functionality. As explained, the tutorial doesn't show the Controller part relevant to this (as far as I can see).

I also see this in log file right now:

 Request validation failed for action "Magento\Framework\App\Action\Forward\Interceptor"
 {"exception":"[object] (Magento\\Framework\\App\\Request\\InvalidRequestException(code: 0):
 Invalid request received at /var/www/html/vendor/magento/
module-backend/App/Request/BackendValidator.php:152)"}

Isn't interceptors supposed to built automatically by Magento 2?

I am not in production mode.

1
  • I would really appreciate some assistance :) – CvRChameleon Jun 15 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.