Skip to main content

New answers tagged

1 vote

PHP Error InvalidArgumentException: "user_id" is an invalid render array key. Site is down after updating

The error is caused by a render array key containing a string but not having a #: 'user_id' => '123', It should be '#user_id' => '123', or it should contain a renderable sub-array: 'user_id' =&...
4uk4's user avatar
  • 102k
1 vote
Accepted

Filtering by taxonomy term reference in jsonapi

The question is not clear, at least for me. Are you GETting some content type - e.g. nodes of article bundle - which have a field_status reference field? And your trying to filter that GET? Namely, ...
Giuseppe's user avatar
  • 1,125
0 votes

Override relation field currently selected value display text

You can achieve this via using the hook_preprocess_field() or hook_field_formatter_view() hook to alter the output. /** * Implements hook_field_formatter_view(). */ function ...
Munish Kumar's user avatar
3 votes

How can I swap an entity form for a given bundle?

I've found a solution, and it was surprisingly simple. The answer was to swap out the entire form in a hook form alter implementation. /** * Implements hook_form_alter(). */ function ...
Jaypan's user avatar
  • 18k
1 vote

How can I display only the current active cart in the commerce_cart_form view?

Right now, the cart module renders a form for each cart provided to it in CartController::cartPage(). You'd need to override that controller to change the logic in that function or alter the page ...
Ryan Szrama's user avatar
  • 7,090
0 votes

How can I add a colspan (or any attribute) to a <td>?

Use '#wrapper_attributes' for the table cell attributes. This allows you to set classes or other attributes on the tag. #wrapper_attributes is used to set the attributes on the element, such as ...
Munish Kumar's user avatar
0 votes

Password reset email link leads to access denied

I stumbled onto this post: https://www.drupal.org/project/drupal/issues/3401709 Once I changed the cookie_samesite values on my services.yml the links started working. parameters: session.storage....
blu's user avatar
  • 458
2 votes

Best practices for the deployment of upgrades from 9.4 to 10.3

The best practice is to do one core upgrade at a time, not try to do multiple core upgrades in an automated sequence. You could write a script to do this, but I imagine the error handling for all the ...
Patrick Kenny's user avatar
0 votes
Accepted

Pagination incorrect due to custom exposed filter

I found a solution. There is this Pager-ID field in the views pager settings. After trying a couple things, I've tried to set a different numeric ID there, too. Afterwards this pager and other pagers ...
jepster's user avatar
  • 971
0 votes

How do I access the orignalId in a webform results export form?

Given that there are no getters defined and I cannot make changes to the underlying classes, the way to go is via Reflection. The following results in being able to obtain the original ID. In case I ...
JAyenGreen's user avatar
1 vote

How to attach a user into a module that updates content?

Require selecting a user as part of module configuration.
mona lisa's user avatar
  • 6,344
2 votes
Accepted

Behavios scripts do not work

This code executes its attached code on document instead of on context. With document, the code will re-run on the entire document if Ajax adds anything to the DOM, whereas with context the code will ...
mona lisa's user avatar
  • 6,344
0 votes

Best approach to n-to-m relations between entities

How i'd probably do it is: Create a "Book poems" (or some other logical name) paragraph type Add a entity reference field to your Poem content type e.g. field_poem Add a page number field ...
unusedspoon's user avatar

Top 50 recent answers are included