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

CKEditor: Wrap link around block-element does not work

I wanted to insert the following source-code in the CKEditor:

<a href=""><p>My Content</p></a>

... but the editor changed it to:

<p><a href="">My Content</a></p>

This can be – as an example – a problem with CSS:

a p {color: blue}

... is not the same as ...

Displaying content in the twig template

Hi,

I am displaying audios like the following,

https://imgur.com/a/36rPDUM

Right now I have a code like the following for display audio.  The fault with this twig code is, everytime item.audio is true a new div is created. 

Preventing File Uploads Based on Magic Bytes

Hi, 

I have my Drupal 7 locked down for uploads based on MIME types and even files that have changed their file names to look like other MIME types. However, we had a security audit done and they want us to be locked down for magic bytes/file signatures. I cannot find any way to do this. Does anyone have any ideas?

If not I guess I guess I will have to write a custom hook. 

Thanks,

Josh

Sessions and PrivateTempStore for Anonymous Users

Hello all:

I am very new to Drupal development, so forgive me if I don't phrase everything in my question quite right. 

I am developing a Drupal 8 module with a multistep form / wizard that will allow students to select courses based on their preferences (answered through questions in the first stage of the wizard). Since I don't necessarily want the high school to worry about creating user accounts for all students, these users will typically be anonymous.

Drupal 7 Plain Text Field

Hi, 

I just had a security audit done of my Drupal 7 site and they were able to demonstrate the ability to run a theoretical XSS attack from a plain text field using Java Script. I have plain text fields on a node that I am altering with JS in my module to validate input but not to change display.  If you do a search for the node the JS will execute and in their example will show a pop-up. 

I must be missing something here because plain text should be escaping JavaScript. Right?

Thanks,

Josh

Display a list of Nodes in Drupal 8

Greetings,

  I've started the processes of converting my Drupal 7 site into Drupal 8.  I'm having a lot of trouble finding the documentation for displaying a list of nodes with my custom module.  I'm able to find the list of node ids and I can pass them to loadMultiple like this:

$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($nodeIds);

My attempt is to pass an array of these nodes to the twig template to be rendered.  I'm trying to implement it like this:

Pages

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