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

How to add Ajax dependent select in exposed filters

I'm working in an issue where I'm using the hook_form_views_exposed_form_alter() to change some fields from textfield to select and they're working fine. The filters are working and the results are ok.

Here the problem starts. Two of those selects are dependent. One of them, when I select the state, should change another one with cities related with such state. Unfortunately this is not working since the view is already using Ajax.

Changing core's routes with event subscriber. Error: Call to a member function setPath() on null.

I am trying to change core's routes with an event subscriber, but I am getting an error.

My code follows:

drupalup_route_alter.info.yml:

```

name: Drupal Up route subscriber
description: altering routes in our drupal instance
type: module
core_version_requirement: ^9

```

DrupalupRouteSubscriber.php:

```

<?php

namespace Drupal\drupalup_route_alter\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

Unable to render iframe from .module in D9

I have a custom module that originated in a D7 build, then migrated to D8, and now currently migrating to D9. Everything renders besides the iframe. When I look at the elements tab in the developer tools of chrome the div wrapper appears but there is no reference to an iframe. I get no errors in the console or in drupal reports. Does drupal not allow iframes to render from custom modules? the iframe code lives in the .module file, I've also tried rending it from the html.twig file and also tried rending a basic iframe from W3schools just to make sure my src was working.

Overriding a Contributed Module Function with No Hook

Hi, 

I feel like I've done a lot of searching around and there's a lot of answers out there using hook_menu_alter, themes, overriding a service, but this is none of the above. The function that I'm trying to tweak is the execute function in views_bulk_edit contributed module in:

/src/Form/BulkEditFormTrait.php 

field select

in a content type I have a select field linked to an entity reference
Through a callBack I update the select with the filtered values of the entity reference
The #option property is filled in like this

Pages

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