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

Custom Normalizer - Rewriting REST Output in an Approproate Way

Hi Everyone,

I am creating a module for Replacing all Relative URLs in the REST Export of Views into Absolute URLs, for consuming in Application. I have actually made this possible, but I am not sure it is the right way to do.

Basically, I have created a module with a service.

ListBuilder URL

How can I put a file url into the operation array?
Example:

$log_file is a url for download the file from file_create_url.

public function getDefaultOperations(EntityInterface $entity) {

$operations = parent::getDefaultOperations($entity);

$operations['download'] = [
'title' => t('Download Log'),
'weight' => 20,
url' => $log_file,
];

}

Thanks.

Drupal 9 InfoParserException

Does it make sense to get this error for a module under development that hasn't even  been activated yet?

Yes, I know, Drupal has not yet been official released.

The website encountered an unexpected error. Please try again later.

Drupal\Core\Extension\InfoParserException: The 'core_version_requirement' key must be present in modules/custom/custom/custommodule.info.yml in Drupal\Core\Extension\InfoParserDynamic->parse() (line 73 of core/lib/Drupal/Core/Extension/InfoParserDynamic.php).

How can we change JS file loading order

Dear All,

I want to load my custom module's js file below the drupal's /core/modules/user/user.js.

I also added js/myfile.js: { weight: -0 }, but didn't work, positive weight not allowed.

Please suggest any solution for that.

Send values from js to php

Hi everyone

In my module i have a js code with some variebles.

 

I want to send the values of variebles in php code (FirstController.php)

I know that js is in client side and php in server but i want a simple way to get values from js to php

js code

var response = something.innertext;

php code

public function example() {

$example = """the value of respone"""

echo $example;

.........

Ajax response not fully rendered

Hello,

I try to handle a list of items on a node advanced form using ajax. Each list item has a textfield and a remove button. There is an add button under the list to add items. Add button and delete buttons use ajax. Items added on page load are ok, but the ones added through ajax are not complete. Textfields do not have default value or description. Moreover, the delete buttons do not seem to work. My code:

Pages

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