I'm developing a Drupal 10 website with the DXPR Builder default theme and have two views that combine Flex Slider with the content events module to display events. My goal is to:
1. Display the first slider for both anonymous users and logged-in users.
2. Display the second slider only for logged-in users who have specific roles (e.g., admin, manager, content creator).
I've attempted to achieve this using Contextual Filters, but I haven't been able to get it to work as expected.
This thread may wander a lot, but the original reason for creating this thread today is that I have a .js file with mostly jQuery instructions within it. This script is supposed to help me re-order a select list on a [Better-Exposed-Filters] form; and, believe it or not, it works! Except on ONE of my many Drupal 10.3 websites.
We had to turn on MySQL's general log to satisfy a security requirement. Recently our site was attacked with a zillion bogus requests. 99.99% of these resulted in 404s it caused our disk space to fill up because the general log was recording every query caused by these bogus requests. Why does Drupal do this?
Is there any way to stop this from happening?
I attempted to implement a "class WhitelistRoutesSubscriber implements EventSubscriberInterface {...}" and redirect the bogus requests with a 403 but that didn't stop Drupal from querying the database.
I'm trying to code a block plugin that will send variable values to the template based on the current URL. I have the block working and displaying for the most part but I'm having trouble getting the path I need to compare to. I've tried looking through the docs and googling but so much of the info is outdated for a Drupal 10 project. My problem is I don't seem to be able to get the services I want via dependency injection in a block and the services I managed to use don't actually give me the path alias that I'm looking for. I'm currently accessing the path info like so:
I'm in Drupal 10 and have an ajax callback where I need it to return two fields. I've gotten this to partially work, but am running into an inconsistency depending on if the field is at the top level or under a tab via form display. In the below example, field_people in form display is a top level field, and field_featured is nested under a tab via form display.