Categories
CMS Development Drupal

Trying to make mass webforms more efficient

I have an application that we’re migrating in to Drupal 8. Its a system that allows the creation of forms for our clients and then allows the submissions by their clients. We create base forms with default questions, they choose their base form and add their own additional questions to it. The form is live […]

Categories
Cache CMS Development Drupal

Disable cache a custom block for anonymous user

I have a custom block, it displays in every pages with dynamic data calculates in every refresh, How can I disable cache for this block for anonymous users? I try with: public function build() { return [ ‘#markup’ => time(), ‘#cache’ => [ ‘max-age’ => 0, ], ]; } It won’t work.

Categories
CMS Development Drupal

Search by title or SKU

Im having a problem when I try to search by SKU or whatever Im new in drupal Drupal core 7.67 | Drupal commerce 7.x-1.15. It does not allow me to finish the string and it delete some strings before I finish typing I have to type the string very quick and paste, can I just […]

Categories
CMS Development Drupal

How to use service container correcly?

I want to use service container inside my class so I have this this: class SomeController extends ControllerBase { protected $entityTypeManager; protected $requestStack; public function __constructor(EntityTypeManagerInterface $entityTypeManager,RequestStack $requestStack){ $this->entityTypeManager = $entityTypeManager; $this->requestStack = $requestStack; } public static function create(ContainerInterface $container) { return new static( $container->get(‘entity_type.manager’), $container->get(‘request_stack’), ); } public function content() { $testEntityTypeManager = $this->entityTypeManager->getStorage(‘node’)->getQuery(); […]

Categories
CMS Development Drupal PHP

DDEV php/twig error “Unknown “link_attributes” filter.”

So I’m trying to setup a local environment with ddev for the first time. I got it running, cloned my live files with git and imported my DB. Site ain’t working and got this in the log : “PHP message: Uncaught PHP Exception Twig\Error\SyntaxError: “Unknown “link_attributes” filter.” at /var/www/html/web/themes/customs/myTheme/templates/menu–main.html.twig Any pointer how to fix that […]

Categories
CMS Development Drupal

Fivestar module custom wiget

I need to create a custom wiget for fivestars. I create module, and implement hook_fivestar_widgets(). I create css file, images. And it works on Open Server on my PC. When i upload this module on hosting and turn on him i see my wiget in admin menu but it not appear in node page. /** […]

Categories
API CMS Development Drupal

How to enable click-sorting for views table display based on Search API index?

I’m trying to create a view with table display based on Search API (database search) index, with column-sorting (column set as Sortable in the display settings). However, this option isn’t available for my view fields, no matter if they are based on string or fulltext Search API fields. Is there anything I can do to […]

Categories
CMS Development Drupal

Editing classes on a div in CKEditor

We are using the ckeditor_div_manager module on our Drupal 8 site to provide the Div Manager plugin on our CKEditor. On of my content editors reports that, while it does allow her to add a wrapper div that has our pre-defined classes onto elements, there is no way with the widgets to edit existing divs […]

Categories
CMS Database Development Drupal

drush migrate-upgrade “[debug] key_value table not found. Database may be empty.”

I am trying to migrate a D7 site to D8 following the steps found here . Once I can manage it and make sure I have all the PHP components, Drupal modules and etc. I have 4 sites to update, and one that I suspect is going to be very difficult. I installed and used […]

Categories
CMS Development Drupal

How can i change path of set-cookie in response header in drupal 8

Below is the sample for Set-Cookie of the response header Set-Cookie: SESS624c7ddad7b0526cc343336fe404e237=cCqo-eSoXpZyKoifc1BVSy8PgelrpkSu7QSlCy96JNg; expires=Wed, 11-Dec-2019 15:44:09 GMT; Max-Age=2000000; path=/; HttpOnly path=/ I want to change the path=/ to path=/xyz/ Please check and let me know if anyone can help with this.