Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
i am trying to make simple custom services with dependency injunction + ajax form. when i am trying to include custom service to my form builder class with help of dependency injunction, i am getting the following error. can you any one help me. i am new for Drupal.
I use Drupal 8 and Commerce 2, I have standard Drupal shipping, have 2 types of product “default” and “downloadable” and set standard shipping in Drupal 8 and Commerce 2.
I have 2 question now:
How I can get product types in order.
How I can programmatically get info (name, cost and etc) for shipping in order.
Now I use:
$order = Order::load(1);
foreach ($order->getItems() as $key => $order_item) {
Hello, I have several modules which have configuration forms attached to them, I would like to add a submit handler to all of them before the systems_settings_form submit handler which looks at the $form_state, checks to see if any values are different to the ones currently stored in the Variables table and writes a message to Watchdog which lists the field name, the original field value, the newly submitted value and the user ID associated with the form values update.
Basically a simple module configuration settings changelog in Watchdog.
I would like to know how to replace one AJAX form with an undo version of the form (for when a page element disappears).
Scenario, a tip (short piece of text) is displayed by default on certain pages to explain what that page does. It's followed by a [hide this tip] submit button.
On submit, a database action is carried out. However, on submit, I also want the tip text to be replaced with an acknowledgement "I won't see the tip on this page again" and with an [undo] submit button.