jbarrio
  • Member for 1 year, 9 months
  • Last seen this week
How to union two views and pass on arguments
Accepted answer
2 votes

What you can do is to load and execute the $view_by_author view as you are doing but passing the by_year arguments/contextual as this: $arguments = [$view_by_year->build_info['parameter_you_need']]...

View answer
How do I log in a user?
2 votes

I'd say in this specific case the error message looks like saying that $user is NULL. You need to validate that User::load returns a valid UserInterface because if the $uid passed to the method is not ...

View answer
How to make node edit form meta panel accordions default to closed?
Accepted answer
2 votes

There are different approaches to change this behaviour. For instance, you could choose between these two at least: CSS + JS: using a selector like .layout-region-node-secondary (depending on Theme), ...

View answer
alter image style attribute
1 votes

Trying to create a CKEditor plugin is not as easy as it might look. I'd suggest to check the amazing module CKEditor Templates (in a nutshell, you will need to extend the CKEditorPluginBase class).

View answer
Is there a way to disable the <nolink> option for menu links?
1 votes

I'd say that I would solve this requirement by doing three things: CSS: easy one, just hide the tooltip about JavaScript: add a client-side validation that checks the value of the link field and if ...

View answer
How to know if a batch process is still running?
Accepted answer
1 votes

As per the API, once you define a batch, you provide the callback function that will be executed when the batch finishes, so until this callback is called, the batch is still ongoing. So ideally your ...

View answer
How to increase image resolution in gallery?
0 votes

One thing is defining the responsive image styles to set specific breakpoints and another thing is to improve the quality of the uploaded pictures. For instance, the Image toolkit allows you to set ...

View answer
Securing admin account, silly "solution" found
Accepted answer
0 votes

Definitely not a solution I would rely on. "Securing admin account" is a wide topic that needs to be handled carefully, but answering specifically to your question, if what you want is to &...

View answer
How to restore layout builder override layouts from old DB snapshot?
0 votes

I can quickly answer the first question. There is a table called node__layout_builder__layout that holds just the nodes that have overridden the default layout for that node. So if you create 2 nodes ...

View answer
Check if the user has read a node, if so give access to the next
Accepted answer
0 votes

I'd say you can use hook_ENTITY_TYPE_view to store the uid and the nid of the user into a custom table. That would solve the easy part, I believe. You'd may start by something similar to function ...

View answer
Batch delete users and the content they created
0 votes

My suggestion is to prepare a text file with 1 username per line and use Drush in a shell script (assuming Drush 8), do this: IFS=" " for user in `cat users.txt` do echo "Cancelling ...

View answer
How to change the default selection in views filter?
0 votes

As stated by prkos in his comment (sorry, I don't have enough reputation to reply to his comment), you could benefit of Better Exposed Filters. What you would need to do is: Enable Better Exposed ...

View answer
How can I disable the cache for a specific page or have the cache ignore query params?
0 votes

I'd say that if you haven't been able to completely turn off cache then something is still preventing you from fully loading 'fresh' pages on every request, which may mean there's still some parameter ...

View answer
How can I export and then import taxonomy terms?
0 votes

Have a look at the YAML Content. Even if it is not covered by the Drupal Security, it may cover your current needs as it will help you exporting and importing your terms.

View answer