#makedevelgreatagain

Dear community, devel is an awesome tool in drupal 7, it works like a charm when using dpm, however in drupal 8, the new tool (Kint) doesn't work fine, it is super heavy and really hard to read. so please #makedevelgreatagain 

include and drupal 8

I'v' made in notepad a php-file;

<?php
echo("hallo");
?>

I've saved this file as hello.php on the server.

Then I make a new content-php 

<?php
include ("hello.php");
?>

De webpage gives  :
include ("hello.php");

in stead off 

hello
 

Assign a role to a user automatically

Hi everyone,

I need to automatically assign a role to users who register according to a given condition in a field during registration.

For example, when an anonymous user registers on the site, there is a field that serves to select the type of user (this field is additional to the basic user registration form). I need that according to the "type of user" that the user chooses, a role is assigned automatically.

I'm working on drupal 8.

Thanks for you support.

Creating Views with the paragraphs module

Hi 

Can someone explain how to create a view if you are using paragraphs.

I urgently need clarity on using the Views page when using paragraphs.

Mock \Drupal::logger in my custom entity tests

Hi all.

I have started to perform unit tests with phpunit and mocks. No problems to mock objects of my custom entities but  when I try to create a mock for the logger (\ Drupal :: logger) I have the following error: 

1) Drupal\Tests\tp_barriers\Unit\BarriersRestTest::testTransformSingleBarrier
Error: Call to undefined method Mock_LoggerInterface_2a821375::get()

My setup method:

How do I load images into an image field in 8.5+ from server?

I have a site that is being upgraded from 6 to 8 and it is image intensive - they are all on my host server. It is a rewrite. I don't want the user to have to upload hundreds images as they are already on the server.  

8.5 doesn't allow Media Entity to be installed (which was a suggested route) as the functionality is now in core, but where can I set up access to the server as an upload route for my user.

Any advice?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x