marionnewlevant / craft-snitch

Craft plugin. Report when two people might be editing the same entry, category, or global
MIT License
35 stars 16 forks source link

Feature request — alert if Fields are being editing by someone else #7

Closed j-greig closed 5 years ago

j-greig commented 6 years ago

This would be super handy as we're often editing complicated Matrix fields on our staging server.

Thanks so much!

James

marionnewlevant commented 5 years ago

@j-greig In theory, you should be able to do this by changing the inputIdSelector configuration value. You would copy the config.php out of vendor/marionnewlevant/snitch/src into config/snitch.php and change the config value to:

   'inputIdSelector' => 'form input[type="hidden"][name="entryId"]' // entry forms
        .', form input[type="hidden"][name="elementId"]' // modals entry forms
        .', form input[type="hidden"][name="setId"]' // global set
        .', form input[type="hidden"][name="categoryId"]' // category
        .', form input[type="hidden"][name="userId"]' // user
        .', form input[type="hidden"][name="fieldId"]', // field (THIS ONE IS NEW)

However, you may get false positives when one person is editing entry 23, and another is editing field 23. I do not have time just now to test this, but if anyone else does, I would love the feedback.

marionnewlevant commented 5 years ago

Fixed for version 2.1.0

j-greig commented 5 years ago

Thank you! :)