Hello, Mustapha Ben Ellafi (benellefimostfa) !
Thank you for a great module!
I use it on one of my projects and found that with latest Drupal core 8.7.8 version "Use Ajax" doesn't work.
It appears because unique_event library doesn't attached because of this line of code (in unique_field_ajax.module):
if(!empty($form['#attached']['library']) && !in_array('unique_field_ajax/unique_event',$form['#attached']['library'])){
property $form['#attached']['library'] is empty and it causes canceling library attachment.
Attached patch solves this issue.
Comments
Comment #2
antonnaviComment #3
maxilein commentedI can confirm that it does not work on core media entities.
It breaks the adding of files through the "media library" widget.
Notice: Trying to access array offset on value of type null in unique_field_ajax_validate_unique() (line 219 of modules/unique_field_ajax/unique_field_ajax.module).
Comment #4
benellefimostfa commented@maxilein,
Did the patch in #2 fix your issue?
Comment #5
maxilein commentedSorry. I should have been more specific. I did no try the patch yet. I just wanted to provide more information in order to make it for others easier to find this issue. As soon as I find the time to try it, I will let you know.
Comment #6
n8tronPatch in #2 seems to have fixed this issue.
Comment #7
zebda commentedI don't know for sure if this is related but I get the following error:
Notice: Trying to access array offset on value of type null in unique_field_ajax_validate_unique() (regel 219 van /site/web/modules/contrib/unique_field_ajax/unique_field_ajax.module). =>
I tried the patch but this didn't fix it. Even when I turn the Ajax function off I get this message.
Comment #9
3liHave made a small change so that the library is always attached, I don't see why we even needed to check that the library array existed or if we have already got the library.
Comment #10
3li@maxilein & @zebda I don't believe the issues you have faced are related to the library not loading.
Please open new issues if you are still having problems.
Comment #11
cprofessionals commentedI wanted to provide feedback. Patch #2 worked for me and specifically with Feeds Fields!... thanks for the great support and module! I now see you commited... will update and try new release.
Comment #13
3li