This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

E.OriginalEvent in drupal forms

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.

Check/uncheck boolean field when uploading image to media library

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've tried different things:

New Features in Drupal 9

What are the new features that added in Drupal 9?

PHP include function in drupal 8

Hi everyone

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?

Import data from CVS file and create or update existing entity created using ECK module

Hi

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

How to log error without specific module reference

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)?

Sincerely,
Teresa Fleming

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions