Extra Block Types (EBT) - New Layout Builder experience❗
Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.
❗Extra Paragraph Types (EPT) - New Paragraphs experience
Extra Paragraph Types (EPT) - analogical paragraph based set of modules.
GLightbox is a pure javascript lightbox (Colorbox alternative without jQuery)❗
It can display images, iframes, inline content and videos with optional autoplay for YouTube, Vimeo and even self-hosted videos.
Scroll
How to change the SQL query in views?
22/02/2025, by Anonymous (not verified)
Forums
Hello, I need to modify a views query.
I'm using hook_views_query_alter
function custom_module_views_query_alter(&$view, &$query) {
if ( $view->name == 'uc_catalog_terms' ) {
$query->where[0]['conditions'][0]['field']="SUBSTRING('taxonomy_term_data.name, 1, 1)";
}
}
However, the query removes all characters, resulting in views making the following query:
WHERE (( (SUBSTRINGtaxonomy_term_data.name11 = 'a') ))
Why are the characters being removed, and how can I address this?
I found on a foreign forum that the error was in version 7x.3.dev,
I am using version 7.x-3.7
- Log in to post comments