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

Creating ticket booking module

Hi everyone!

I'm creating a module in Drupal 7 for ticket booking and I need a little help.

I have added a menu link where my newly created module opens up a form and that form needs to have: 

a hidden field for current user

a field with performance title for users to choose from

a field with dates available (this should actually be nested within the performance, but first things first)

a filed with number of tickets that user wants to purchase

Use the user picture to set default image in a node

In a hook for alter, I try to set a default image, that is the user posted picture.

$author = $node->getOwner();

$user = \Drupal\user\Entity\User::load($author->id());

if (!$user->user_picture->isEmpty()) {

   $displayImg = file_create_url($user->user_picture->entity->getFileUri());

   $form['field_avatar']['widget'][0]['#default_image'] = $displayImg;

This error showed up in brightcove_playlist trying to edit a playlist

I'm using this version of brightcove in D9

"drupal/brightcove": "dev-3146320-D9-compatibility",

and this error showed up when I clicked on edit button.

Synchronous XMLHttpRequest Error when use module "Commerce Ajax Add to Cart"

I'm using module "Commerce Ajax Add to Cart" create button Add to Cart on Detail Product. But when I click "Add to Cart", It got a error 
"[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/"
 This is a link error.

not working module google analytics in drupal 9

hello,

i've has installation module google analytics in my server and localhost. but i've already follow step in this linka https://www.youtube.com/watch?v=EOr8A68koEg to do, the module is still not working and tracking id.

Why is not working?

having any solution for this?

Weird behaviour with WebDriverTestBase and drupalGet

 I'm a new Drupal developer and this is my first time writing test for an existing module created by another developer. I am using the WebDriverTestBase with chromedriver. When running the test, the main page does load out in the chromedriver browser. However, when the code below runs, it says Page Not Found. 

Pages

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