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

How to apply a patch through composer-patches ?

Hi,

I'm using Lightning 8.x-4.003, drupal core 8.7.7,  using composer.

I want to apply a patch : https://www.drupal.org/files/issues/2019-07-26/drupal-add-unpublished-nodes-to-taxonomy-index-962664-130.patch for issue: https://www.drupal.org/project/drupal/issues/962664 , this patch will modify core taxonomy module.

Using .install file with a feature

I have created a feature(user_password_policy) which sets configuration values for the password_policy module and the force_password_change module.  However, some settings are not picked up by strong arm so I need to make these changes with hook_update_N.  

Do I create an install file, user_password_policy.install?  If not, how can I do db updates in my feature?  

For the update function, do I call it 

function force_password_change_update_7100() {  In other words, do I reference the module I want to refer to in my feature?

Error in getting the title of a form using $form_state->getValue()

Hi,

I have written a custom function, where I need the title of the form. I am using the following to get the title:

$title = $form_state->getValue('title');

But it returns an array. I need a value like 1.1 (the title of the form is 1.1).

I need the title of the form to do a database query, something like this:

db_query('SELECT title FROM `node_field_data` WHERE title = :title AND langcode = :langcode',[':title' => $title,':langcode' => 'en'])->fetchField();

Check for duplicate nodes of given title

Hi,

Before saving a node with a title, I want to check if the node with given title and language already exists or not. I have seen examples with hook_form_alter(), but I am not following much. And obviously not working. This is what my code looks like:

Generating a list of all available operations of a given entity

I have a module mostly built that provides custom entity access checking via a class inheriting from EntityAccessCheck. The ::access method is called properly and works well in most cases. This module includes a UI that lets an admin specify, for a given entity, what operations are available to each user. The problem is that, if I use ListBuilder::getOperations($entity) and ListBuilder::getDefaultOperations when generating this interface, the ListBuilder class checks what operations the current user has access to. Instead, I need a list of all operations.

Pages

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