Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I have built a form as part of a module that contains an entity reference item; this item based on an entity reference view which has a contextual filter default of the current user.
I want to enable an override in my form to display those items associated with a different user. In essence, I want to set the View Arguments programmatically. However, I cannot see how to pass the argument to the widget in the form code.
Can this be done? I've tried to hard code in an argument, and cannot see where this value is stored in the $form array.
I like to have a text field block where I can enter a dollar value. System will generate 7% of that value. Like count down, System should show the number starting from 1 as it is calculating.
I am trying create module, which check every nodes (type "article") and replace some string - for example external url to something what I wish. My problem is, that print_r or var_dump after node_load is too big and I get error Allowed memory size of 805306368 bytes exhausted.
I get "Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:file:undefined" plugin does not exist. Valid plugin IDs for Drupal\Core\TypedData\TypedDataManager are ... Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)"
So, I cannot upload any new module. Any ideas how to solve this?
I have a search page that has filters on the left bar and results on the right. I want to display the 'Sort by' drop down on top of the 'Results' section. I have a custom template for the results section alone -> views-view-fields--search.html.twig. Not sure how to add the 'Sort by' drop down in this file. Any help?!