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

Help with first custom module

Hey! I'm extremely new to Drupal development and have the following code:

kay_user.module:

<?php

/**
* @file
* Task 1 - only ask for email address and change username label to Full Name
*/

use Drupal\Core\Form\FormStateInterface;

field_geofield_distance always returns all zeroes

Hi everyone,

I'm new to the Drupal community with almost no experience from it, recently I got one project done in Drupal 7.x and I'm having some issues with geofiled distance.

The app is listing some stores and it should show you the distance between you and that shop, field is called field_geofield_distance but it always returns 0. We have valid Google geolocation API key, location is allowed and the site is running under PHP 5.6(doesn't work at all on higher versions).

I would appreciate if someone can help me were to look an what to do with this.

Submit webform with AJAX and reuse data in some fields

Hi, 
I have a form submitted using AJAX, the form contains two fields. name and favorite movie.
I want the user to be able to submit the form a few times but I don't want him to write his name each time.
I want the name value he added to remain in the name input, and the movie field to be cleared with each submission
How can I do this using the webform module?
I know I can do it using local storage or cookies but I want to know if the webform module has a native way to do so.

Thank's
​​​​​​​

Title as h1 using Layout Builder

Hi,
I'm creating a site on Drupal for the first time
I'm using Layout Builder to display news. I add a title block, but it displays as span:
<div class = "content">
       <span class = "field field - name-title field - type-string field - label-visually_hidden"> Title 1 </span>
     </ div>

how to change it to h1?

Thank you.
ps. sorry for my English

How should I provide data to service?

Hello,

I have a question. I would appreciate your answer.

How should I provide data to my service correctly? For example in submitForm:

$this->session->set('var1', $name);
$this->session->set('var2', $count);
$form_state->setRedirect('test.task');

Then I have service where I want access the data from session and save in database. Should I read data from session in controller and pass to service by parameter? I guess no but I don't have any other idea. Regards :)

Slow performance of Drupal 7 site

Dear community

I need some help understading why my website is slow (TTFB), I have installed devel module and I can see that for some reason the semaphore table takes a lot of time deleting/inserting records. As I understand this is part of Drupal core but why is it that slow ? 

What can I do to sort this out ?

Pages

Subscribe with RSS Subscribe to RSS - Module Development and Code Questions