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

What's the correct way to set a field value in views_pre_render?

Here's my code.

I'm trying to populate a custom text field that has a default value with a new value thus:

function mytheme_views_pre_render(Drupal\views\ViewExecutable $view) {
if ($view->id() == "contacts" && $view->current_display == 'block_7') {
foreach ($view->result as $row) {
$cid = $row->_entity->id->value;
$cs = lgf_checksum_get($cid);
if ($cs) {
$row->_entity->nothing->setValue($cs);
}
}
}
}

It's throwing this error 

Dependencies version restrictions not working (.info.yml file)

Hello,

I am trying to add the exact version of AnimateCSS module for a new module in the .info.yml dependencies.

My code is as follows:

Drupal throws warning after deleting unneeded .module

Drupal 10 is supposed to work fine if there is no .module file in a project.

However, if I install an module project (named say, Example) that initially came with example.module and later found that that file was no longer needed in the project, deleting it throws this warning when the cache is rebuilt:

ERROR while loading config page in drupal 7.94

Hi guys,

 when I try to load the config page but I can able to load rest of the pages like  admin/config/development .But when i load this page admin/config/ iam facing this issue 

ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in DOMDocument->loadHTML()(line 22 of echo.install)

and the line is this 
$document->loadHTML(echo_themed_page($title, $content, $theme));

Any suggestions 

thanks,

Need a module to type in search field using Indian scripts

I want to enter text using Indian

Script “Punjabi”, I found a module “indik_script” but it is for drupal 7 and I am using Drupal 10. suggest me any other module which will solve the purpose.

thankyou

javascript function Drupal.t() does not work for me.

I am  using "String overrides:" as indicated in settings.php file

example:

609 # $settings['locale_custom_strings_en'][''] = [
610 #   'forum'      => 'Discussion board',
611 #   '@count min' => '@count minutes',
612 # ];

These are working from php code; however when I use Drupal.t(....) in javascript code, the translations are not picked up.

I see that drupal.js has the code where it reads window.drupalTranslations (which is prepared by locale module)

I tried to look into this in browser console by calling

Pages

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