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

Drupal7: Is it possible to call an hook_menu with the POST method?

Hi,

in a custom module, I'd like to call a hook_menu using the POST method because I have to pass some data in the body of the request.

Is it possible?

What changes in its definition?

$items['/feedback'] = array( 'title' => 'Sent', 'page callback' => 'feedback_received', 'type' => MENU_LOCAL_TASK, 'access callback' => 'user_is_logged_in', );

And how can I get the data in the 'feedback_received' callback?

Thank you very much

How to override assertSameCurrency function in commerce?

In web/modules/contrib/commerce/modules/price/src/Price.php

We have

protected function assertSameCurrency(Price $first_price, Price $second_price) {
// Code
}

How to override this function in custom module?

php warning: Deprecated function, after form submit

Hi,

I have an ajax callback function in the form submit:

$form['display'] = [
     
      '#type' => 'button',
      '#value' => $this->t('More'),
       '#ajax' => [
        'callback' => 'Drupal\heritage_ui\Controller\HeritageTextContent::metadataDisplay',
        'effect' => 'slide',
        'event' => 'click',
      ],
    ];

I am getting a php warning:

Could not retrieve the oEmbed resource

I am facing an issue while uploading image in media library that your image could not retrieve the oEmbed resource.

Help will be appreciated.
 

ParseError: syntax error, unexpected 'public' (T_PUBLIC)

Hello,

Following code gives me error

"The website encountered an unexpected error. Please try again later.
ParseError: syntax error, unexpected 'public' (T_PUBLIC) in Composer\Autoload\includeFile() (line 41 of modules\custom\rsvplist\src\EnablerService.php)."

Address requires the commerceguys/addressing library

Hi,

I don't know how to install correctly the module Address with Drupal 8.

I don't use Ludwig nor Composer.

How to make it using classic ftp ?

Pages

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