Categories
CMS Drupal Mastering Development

using Drupal Group (notOG) how do you get the list of permissions

I am trying to use the group method hasPermission(permission_label, user). I found an example that is the following: $group->hasPersmission(‘administer members’, $user) I would like to know what all the different permissions types are. In particular I want to be able to differentiate whether a user can edit or just view a type of content. How […]

Categories
CMS Drupal Mastering Development

Are there migration plugins for D8 sources?

I found 2 references here for migrating D8 to D8, but both are very outdated. Certainly there will be a need to do D7 -> D9 or D8 -> D9 migrations for many, but there are also current use cases. One is migrating from a multisite to individual sites. Mine is the site restructuring its […]

Categories
CMS Drupal Mastering Development

Entityqueue + inline entity creation?

Background / use case The entityqueue module is a great way to bridge content with configuration: The entity queue is created in config, and created automatically on deployment. It can then be included into a panels page or another type of configured element. The entities can be created, placed and controlled by editors, without polluting […]

Categories
CMS Drupal Mastering Development

How to redirect after node insert (not form redirect)?

I am trying to find out how to redirect after I insert a new node. All the answers I have been able to find discuss $form_state->setRedirectUrl(); but this is a form redirect; not a proper redirect after insertion. The difference is that when I submit the node form; I use hook_node_insert to create another entity […]

Categories
CMS Drupal Mastering Development

Update failed on Metadata module, any easy fix?

I am very sorry to bring a rather nebulous question here but need any and all help I can get: for the first time, I’ve had a “White Screen of Death” issue when trying to update a module. I believe it was the “Metadata” module but I don’t even remember for sure. I had a […]

Categories
CMS Drupal Mastering Development

RESTful Web Services : How to simply post a paragraph entity

I have simply activated the default paragraph ressource with core (8.8.3) module : I would like to post a paragraph but even just with the “type” field, I got 403 error in response ! I have nearly the same request that works fine for node… var newReleve = { type: [{ target_id: ‘releve_de_chantier’ }], parent_id: […]

Categories
CMS Drupal Mastering Development

Troubles deploying Drupal on Heroku

I’m trying to deploy my drupal (8) application on heroku. I’ve already created the db with heroku jawsdb and set up the credentials on site/default/settings.php. $databases[‘default’][‘default’] = array ( ‘database’ => ‘DB’, ‘username’ => ‘USERNAME’, ‘password’ => ‘PASSWORD’, ‘prefix’ => ”, ‘host’ => ‘AWS_URL_DB’, ‘port’ => ‘3306’, ‘namespace’ => ‘Drupal\\Core\\Database\\Driver\\mysql’, ‘driver’ => ‘mysql’, ); When […]

Categories
CMS Drupal Mastering Development

Vimeo embed code being ignored

Feeling frustrated. I run an number of websites, and have recently had need to embed video (mostly Vimeo but not exclusively) in one of them. I have another site where I have embedded the code successfully using the process of: ‘set plain text, paste embed code, select Full HTML’ – bingo all is well. When […]

Categories
CMS Drupal Mastering Development

Custom node access control not working with access filter?

In some of mine content types I have checkbox field “Content protect”. If checked that node should be visible only to registered user. If not checked – visible to everyone: function hook_node_access($node, $op, $account) { // If $node is a string, the node has not yet been created. We don’t care // about that case. […]

Categories
CMS Drupal Mastering Development

webflo and behat issue preventing patch via composer

I am attempting to install a patch for the smtp module on a Drupal 8.8.4 vagrant dev instance. Trying to do so fails with the following error: Your requirements could not be resolved to an installable set of packages. Problem 1 – webflo/drupal-core-require-dev 8.8.4 requires behat/mink 1.7.x-dev -> no matching package found. – webflo/drupal-core-require-dev 8.8.4 […]