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

Question re hook_node_access_records

Goal of this project is to create permission system using node reference field. In this scenario my nodes are products and users are printers. Site admin can assign printer to each product and printer can only see products that are referenced to him.

Using hook_node_access I can control the access, but there is a problem with Views where all products are displayed, despite of the limit.

What is the ':input[name=???]' of a subform field?

Hi all, and thank you for your contribution.

I have created a custom content type with a field ('field_table_2') that is a (list of) paragraph element reference entity.

The paragraph entity, contains 'select' fields (e.g. 'field_rsn', 'field_added', 'field_deleted' ), that we need to hide or show according to selection.

We are reading about Conditional-form-fields, but we cannot find a way to refer to the subform field, eg.:

Creating a security plugin

Hello,

Hope you don't mind, but will help me a lot to see your opinion on the following. What do you think about the plugin idea described bellow?

A plugin to complement the other security solutions on Drupal. It would work like this:
- create a threat map of the application in case of an attack
- it doesn't matter how the hacker got access and what vulnerability he used. That means It won't look for attack vectors because can be 0days attacks.
- will only monitor those points where a hacker who gained access would enter

Libraries file isn't loading the javascript files and also dataTable issue

As the subject says, the libraries file isn't loading the javascript files under (icemagic.libraries.yml).
(Also english isn't my first language so apologies in advance for my grammar)

Here's a look on the code:

Problem in routing/ js

Hi everyone

I creat a module. I have my .js file that catch attributes in an IFrame(h5p) with console.log)

When i clear the cache, i go directly to the page that i want and console.log is working( i catch attributes) but when i clear the cache and go to Home page(or any other page in drupal) and then i go to the page that i want, nothing happens (console.log doesn't work).

How to load existing media into a media field programmatically

Hi, I have a content type called Car, where I want to load existing uploaded media programmatically while adding new content when media field is empty. I have the media id number, I tried Media::create by doing so I am getting duplicates of the same image. I tried Media::load by getting media id, its not working. any assistance would be really helpful.

Pages

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