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

How can I add a link appear in /admin for a specific role

Hello

I try to add a link appear in /admin for a specific role. This specific role has a few permissions (adding specific content for example) and I would like to hide certain links appear in /admin and to add other links in this same page.

I tried to use the hook MYMODULE_page_attachments_alter but I did not find the way to add links into this.

What solution for this ?

Thanks

Extending the Better Exposed Filters module to support a JSON field

What are the steps to follow to add new exposed filter widget for a JSON field added using the Views JSON Source module?

Tutorial: PHP Enumerations and Drupal List Fields

Overview

PHP 8.1 introduced a new data model, Enumerations. Enumerations allow for the creation of custom data models that can only contain a fixed set of allowed values. These enumerations can be very useful when working with Drupal list fields, which are a field type that allows for selection from a predefined set of values. As both enumerations and list field contain a predefined set of values, using Enumerations to back Drupal list field makes for more stable code that is easier to understand, and less likely to fail. 

Can't filter views according to user roles

I'm developing a Drupal 10 website with the DXPR Builder default theme and have two views that combine Flex Slider with the content events module to display events. My goal is to:

1. Display the first slider for both anonymous users and logged-in users.

2. Display the second slider only for logged-in users who have specific roles (e.g., admin, manager, content creator).

I've attempted to achieve this using Contextual Filters, but I haven't been able to get it to work as expected.

All things Javascript vs jQuery

Hello friends,

This thread may wander a lot, but the original reason for creating this thread today is that I have a .js file with mostly jQuery instructions within it.  This script is supposed to help me re-order a select list on a [Better-Exposed-Filters] form; and, believe it or not, it works!  Except on ONE of my many Drupal 10.3 websites.

[SOLVED] Drush sql-dump results in Error 2013: Lost connection for "key_value" table

I'm getting a new error backing up a site database via Drush. The command I use is:

drush sql-dump --gzip --result-file=/home/my_site/public_html/private/backup_migrate/manual/file_name.sql

But this results in the error:

mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `key_value` at row: 105254

This is the case on both the live server and on my local enviroment (I use Lando).

Can someone point me towards how I can debug this?

Pages

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