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

(D9) Change max length of slogan field in translation

With THEME_form_system_site_information_settings_alter i can change the max field length of the site_slogan form, like:

function THEME_form_system_site_information_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['site_information']['site_slogan']['#maxlength'] = 500;
}

Apparently the form for the slogan in the site information translation is different,

thus forexample in /admin/config/system/site-information/translate/en/edit

There is other form for the slogan.

Cannot flag nodes and comments automatically

I created a code to automatically flag nodes and comments. When I put only the code to flag the nodes, it works. But when I add the code to flag the comments it doesn't work anymore.

Which code should I use ?

How to display the rendered entity of a store in a code ?

I have created a small module (Drupal 8) to display an "Agree to Terms" link in the Drupal Commerce shopping tunnel.
This link displays the store's condition page.
I want to display the rendered store entity instead of the conditions page. How to do this ?
I created in my type of store, a display named "Terms and conditions". I want to make this display in a modal window when the user clicks on the link.

Here is my code :

How to search for entities by label / title?

I am really lost, and need some guidance.

Drupal is capable of doing something, that I want to leverage/exploit. 

But I can't figure out how to access this component in an isolated manner, everything seems to be deeply entangled, and every class I find that does what I need, requires 5 container classes and injections and dependencies...

So I'm out here asking to see if someone can help, before I need to literally read thru the entire code base to figure it out.

WidgetBase breaks on $array['add_more'], radios

I'm using HOOK_form_alter to store a string for a taxonomy entity. Because I want to be graphical, I'm using the Form API radios type combined with special CSS for my customers to choose which color they want.

Relevant portion of mymodule.module

How to create a custom module to automatically flag new entities ?

I created a small custom module to automatically flag new or updated entities.

My code doesn't work, there must be some errors. Can you help me ? Thank you

https://git.drupalcode.org/sandbox/zenimagine-3170711

Pages

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