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

Need help with a simple custom service with form builder - You have requested a non-existent service

Hi Guys,

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.

Error:

[SOLVED] Drupal 7 - node state in submit callback function

Hi,

I want to copy / clone a field to another node field when I save a node.
Example : 

$node_1->field_1 = $node_2->field_1;
node_save($node_1);

I have added a new submit function with hook_form_alter()

Drupal 8 Commerce 2 get Item from order

Hi, 

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: 

  1. How I can get product types in order. 
  2. 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) {

Drupal 7: Adding a submit callback to existing admin modules to check if values have changed

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.

How do I replace an AJAX form with an Undo version of the form?

This is my first AJAX form.

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.

Creating a custom field module

I am trying out creating a custom field module for views, but I keep getting this error when I apply the field on the view. 

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'views_report_state_field' in 'field list'

Here is my code:

FILE - views_report_state.info

name = Views Report State
description = Turns short abbreviated states (ex: TX) into fully readable names (ex: Tx = Texas)
package = Views
core = 7.x

files[] = views/views_report_state_field.inc

Pages

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