spicywebau / craft-batch-actions

A Craft CMS plugin for performing batch actions on Matrix and Neo blocks
MIT License
4 stars 3 forks source link

Clicking add block to matrix does not work set to maximum of 1 in inline editable format when Smith is installed #11

Open akukral opened 2 months ago

akukral commented 2 months ago

Bug Description

Description

In element view on a structured entries page editing multiple entries at once unable to change or edit Link Field type entries that are as URL in selection dropdown.

Operating system and version

Mac Sonoma 14.6.1 / DDEV version v1.23.2

Database type and version

MySQL 8.0.36

Image driver and version

Imagick 3.7.0

Installed plugins and versions

Steps to reproduce

  1. Create matrix field with at least one entry type
  2. Not Required
  3. Minimum entries: empty
  4. Maximum entries: 1
  5. View Mode: inline editable block

image

  1. Add field to entry
  2. Add a block to matrix field

image

Expected behavior

Clicking add block will show editable entry type of choice.

Actual behavior

Nothing appears when clicking on buttons. Clicking the button does work if the matrix field is set to Cards or Element Index or Batch Actions is disabled.

Batch Actions version

2.0.1

Craft CMS version

5.4.0.1

ttempleton commented 2 months ago

Do any errors appear in the browser console?

akukral commented 2 months ago

No errors in the console that I can see associated with the plugin or the matrix field.

ttempleton commented 2 months ago

Try disabling your other plugins and confirming that Batch Actions is working at that point, then re-enabling them one-by-one to see when it stops working. I'm guessing one of them (possibly Matrix Extended?) is conflicting with Batch Actions.

akukral commented 2 months ago

Turns out it's a conflict with the Smith Plugin from Verbb. If Matrix Extended is enabled but Smith is disabled batch actions still works and I get the benefits of Batch actions and Matrix Extended with copy, paste, clone.

ttempleton commented 1 month ago

Thanks for that extra info, I'm now able to reproduce it. It's happening because of the kind of hacky way we need to hook into Smith's functionality - it involves adding an empty <div> to the start of the Matrix blocks' container element as a dummy block, and then creating a Smith menu on that block. Since Craft checks if new blocks can be added based on the number of child elements the container element has, our dummy block has already maxed out the count. Unfortunately I don't think we can work around that, but I'll keep this open in case I can figure out a solution in the future.

akukral commented 1 month ago

Hopefully something works out. Thank you for the explanation.