Wildcard URL shortcode parameter
-
I have the free version of WP Data Access (5.2.9)?on ‘WordPress 6.1.1 running?Astra Child theme’?with PHP 8.0 and I’m having a problem with URL shortcode parameters with wildcards.? I have tested with WA Data Access being the only active plugin.
I am displaying event details and the issue I have is searching on a year which has to be extracted from a date string. This is a historical database and I have to work with it as is. The default WHERE clause is:
YEAR(date) = YEAR(CURDATE())
and the database date?column is:
date? ? tinytext? ? utf8mb4_unicode_520_ci? ?Yes? ??
and that works just fine. In fact all the database accesses work fine in your Query Builder or in phpMyAdmin , for example:
SELECT?*?FROM?wpws_fhsc_calendar_events
?WHERE?date?LIKE?“2022%”
The shortcode I’m using is:?
[wpdataaccess pub_name=”fhsc_calendar_events”]
which works fine without any URL parameter overrides.??However, when I try to use URL parameters like this:
…?wpda_search_column_date=2020%
the rendering does not complete and?the Chrome console shows an uncaught error in wpda_datatables.js at line 323. Looks like decodeURIComponent doesn’t like the trailing % character?? I tried 2020%25 to see if that would work and there was no error but nothing rendered.
Uncaught Error
wpda_datatables.js?ver=5.2.9:323 Uncaught URIError: URI malformed
? ? at decodeURIComponent (<anonymous>)
? ? at String.<anonymous>?(wpda_datatables.js?ver=5.2.9:323:28)
? ? at Function.each (jquery.min.js?ver=3.6.1:2:3003)
? ? at data (wpda_datatables.js?ver=5.2.9:319:12)
? ? at Tt (jquery.dataTables.min.js?ver=5.2.9:4:25958)
? ? at Jt (jquery.dataTables.min.js?ver=5.2.9:4:32745)
? ? at Object.success (jquery.dataTables.min.js?ver=5.2.9:4:6431)
? ? at c (jquery.min.js?ver=3.6.1:2:28327)
? ? at Object.fireWith [as resolveWith] (jquery.min.js?ver=3.6.1:2:29072)
? ? at l (jquery.min.js?ver=3.6.1:2:80045)
I also made a quick test with [wpdadiehard project_id=”2″ page_id=”6″] and the table did render but the same?uncaught error occurred immediately afterwards.
I’d appreciate any advice you have on getting this working because my initial testing with your plugin looks very, very promising!
- The topic ‘Wildcard URL shortcode parameter’ is closed to new replies.