Hello iam using ajax in my drupal forms and i need to apply a test on my event witch is a user triggered or code triggered!
So, drupal forms provide an event key:
[#ajax] => array(
'event' => 'change',
... )
I need something like this to know about the event origin:
If(e.originalEvent) {
// user triggered
} else {
// code triggered
}
My purpose is to test my event and knowing that change event caused by code triggered (jquery replace html by ajax) or user triggered.
Since I can't find a solution, maybe someone can give a hint?
I have a form of a certain content-type where users can enter data and upload images (type: Media Library -> image, entity referencing). In addition, I have a Boolean field (uploaded images: yes / no) that I would like to use elsewhere.
(How) Is it possible that the Boolean field (BF) is automatically checked as soon as the user uploads an image?
I am currently using drupal 6, planning an upgrade to drupal 8 or 9.
I am using the PHP module now but plan to ditch it.
In my content (written articles) are inserted google ads.
The code for the google ads is in a file named adsense-central.php and i call it within my articles by using the php function :
<?php include("./adsense-central.php");
?>
How could i continue having my adsense code located in a single file for easy modification and calling that code to my content without using PHP module?
i have created 4 entities using ECK module in drupal 7 (candidat, subject, ...)
what i need is to crerate custom module import cvs file and when i imported my data i would like to updated existing data in all entites like for exemple candidat whene i import first and last name of candidat i would like to update cnadidat if existing if note create new one
can i do that for other entities in one module code
I want to write to error log on a Drupal 9 installation. I need to get the log for a specific condition to solve some errors that hit "core/install.php" drupal resource, due an unknown condition.
I noticed that in Drupal 9, I can use:
\Drupal::logger('my_module')->error($message);
Given the fact that I don´t know the module´s name, how can I add an entry to error log (using \Drupal::logger or another alternative)?