New answers tagged 10
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' =&...
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, ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...
1
vote
How to attach a user into a module that updates content?
Require selecting a user as part of module configuration.
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 ...
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 ...
Top 50 recent answers are included
Related Tags
10 × 462views × 51
theming × 33
webforms × 27
forms × 24
entities × 23
composer × 19
nodes × 18
upgrading × 18
commerce × 17
database × 16
blocks × 16
migrations × 16
wysiwyg × 12
media × 11
hooks × 11
javascript × 10
drush × 10
configuration × 10
ajax × 9
navigation × 9
users × 8
authentication-authorization × 8
caching × 7
paragraphs × 7