Pods: PODS template not sorting using "orderby"

Created on 8 May 2019  路  2Comments  路  Source: pods-framework/pods

Issue Overview

Showing rental units available on the website "https://arlingtonpropertymgmt.com/" and attempting to sort by "date-available" field using orderby. Either no change to order of display or resulting in error message "Please provide either template or field name"

Expected Behavior

Hoping to display PODS data for available rental units in order of ascending date.
Uploaded screengrab of original display with no attempt to sort:
original
Uploaded

Current Behavior

When using this syntax :
[pods name="post" template="rentals" orderby="DATE(date-available.meta_value) ASC" where="availability.meta_value = '1'"]

or this:
[pods name="post" template="rentals"聽orderby="CAST(date-available.meta_value as DATETIME)" where="availability.meta_value = '1'"]

or this:
[pods name="post" template="rentals"聽orderby="DATE(date-available.meta_value)" where="availability.meta_value = '1'"]

...on a test page ("https://arlingtonpropertymgmt.com/test/")

...the display is an error message "Please provide either template or field name" and no data displayed.

Screengrab:
error_message

Steps to Reproduce (for bugs)

  1. without the orderby syntax, the data displays unordered
  2. with any of the three options for orderby syntax the tempate/field error message displays

Possible Solution

Do I have a simple text error? Is the field name "date-available" a problem because of the symbol "-" or do I have to change the field name etc to include "_" instead?

WordPress Environment

WordPress 5.1.1 running rentalproperty theme

Debug Information
WordPress Version: 5.1.1

PHP Version: 5.6.27

MySQL Version: 5.6.32

Server Software: Apache

Your User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.132

Session Save Path:

Session Save Path Exists: No

Session Save Path Writeable: No

Session Max Lifetime: 1440

Opcode Cache:

Apc: Yes
Memcached: No
OPcache: Yes
Redis: No
Object Cache:

APC: Yes
APCu: Yes
Memcache: Yes
Memcached: No
Redis: No
WPDB Prefix: wp_9t3khd9gqx_

WP Multisite Mode: No

WP Memory Limit: 40M

Current Memory Usage: 16.233M

Current Memory Usage (real): 18.000M

Pods Network-Wide Activated: No

Pods Install Location: /home/content/p3pnexwpnas16_data01/05/41892505/html/wp-content/plugins/pods/

Pods Tableless Mode Activated: No

Pods Light Mode Activated: No

Currently Active Theme: rentalproperty

Currently Active Plugins:

API KEY for Google Maps: 1.2.0
Duplicate Post: 3.2.2
FooBox Image Lightbox: 2.6.4
FooGallery: 1.6.17
LiteSpeed Cache: 2.9.6
Ninja Forms: 3.4.5
Ninja Forms - Addon Manager: 3.0.13
Passster: 3.2.0.5
Pods - Custom Content Types and Fields: 2.7.12
Really Simple SSL: 3.1.5
Search Engine Visibility: 0.5
SiteOrigin CSS: 1.2.4
UpdraftPlus - Backup/Restore: 1.16.10
Widget Importer & Exporter: 1.5.5
WP Google Maps: 7.11.16
WP Google Maps - Pro Add-on: 7.11.21

Pods Package Export (helpful!)

arlingtonpropertymgmt_export.txt

{"meta":{"version":"2.7.12","build":1557321936},"pods":

{"1015":

{"id":1015,"name":"post","label":"Post","description":""

,"type":"post_type","storage":"meta","object":"post","al

ias":"","fields":{"date-available":

{"id":1016,"name":"date-available","label":"Date 

Available","description":"","help":"","class":"","type":

"date","weight":0,"pick_object":"","pick_val":"","sister

_id":"","required":"0","date_type":"format","date_format

":"mdy","date_allow_empty":"1","date_html5":"0","oembed_

enabled_providers_funnyordiecom":"0","oembed_enabled_pro

viders_photobucketcom":"0","oembed_enabled_providers_pol

ldaddycom":"0","pick_post_status":

["publish"],"admin_only":"0","restrict_role":"0","restri

ct_capability":"0","hidden":"0","read_only":"0","roles_a

llowed":

["administrator"],"rest_read":"0","rest_write":"0","rest

_pick_response":"array","rest_pick_depth":"2","unique":"

0","date_repeatable":"0","date_format_custom":"","date_f

ormat_custom_js":""},"community":

{"id":1017,"name":"community","label":"Community

\/Model","description":"","help":"","class":"","type":"t

ext","weight":1,"pick_object":"","pick_val":"","sister_i

d":"","required":"0","text_allow_shortcode":"0","text_al

low_html":"0","text_allowed_html_tags":"strong em a ul 

ol li b 

i","text_max_length":"255","oembed_enabled_providers_fun

nyordiecom":"0","oembed_enabled_providers_photobucketcom

":"0","oembed_enabled_providers_polldaddycom":"0","pick_

post_status":

["publish"],"admin_only":"0","restrict_role":"0","restri

ct_capability":"0","hidden":"0","read_only":"0","roles_a

llowed":

["administrator"],"rest_read":"0","rest_write":"0","rest

_pick_response":"array","rest_pick_depth":"2","unique":"

0","text_repeatable":"0","text_placeholder":""},"detail"

:

{"id":1018,"name":"detail","label":"Description","descri

ption":"","help":"","class":"","type":"text","weight":2,

"pick_object":"","pick_val":"","sister_id":"","required"

:"0","text_allow_shortcode":"0","text_allow_html":"0","t

ext_allowed_html_tags":"strong em a ul ol li b 

i","text_max_length":"255","oembed_enabled_providers_fun

nyordiecom":"0","oembed_enabled_providers_photobucketcom

":"0","oembed_enabled_providers_polldaddycom":"0","pick_

post_status":

["publish"],"admin_only":"0","restrict_role":"0","restri

ct_capability":"0","hidden":"0","read_only":"0","roles_a

llowed":

["administrator"],"rest_read":"0","rest_write":"0","rest

_pick_response":"array","rest_pick_depth":"2","unique":"

0","text_repeatable":"0","text_placeholder":""},"rent":

{"id":1019,"name":"rent","label":"Rent","description":""

,"help":"","class":"","type":"currency","weight":3,"pick

_object":"","pick_val":"","sister_id":"","required":"0",

"currency_format_type":"number","currency_format_sign":"

usd","currency_format_placement":"before","currency_form

at":"i18n","currency_decimals":"2","currency_decimal_han

dling":"none","currency_step":"1","currency_min":"0","cu

rrency_max":"1000","currency_max_length":"12","oembed_en

abled_providers_funnyordiecom":"0","oembed_enabled_provi

ders_photobucketcom":"0","oembed_enabled_providers_polld

addycom":"0","pick_post_status":

["publish"],"admin_only":"0","restrict_role":"0","restri

ct_capability":"0","hidden":"0","read_only":"0","roles_a

llowed":

["administrator"],"rest_read":"0","rest_write":"0","rest

_pick_response":"array","rest_pick_depth":"2","unique":"

0","currency_repeatable":"0","currency_placeholder":""},

"availability":

{"id":1020,"name":"availability","label":"Availability",

"description":"","help":"","class":"","type":"boolean","

weight":4,"pick_object":"","pick_val":"","sister_id":"",

"required":"0","oembed_enabled_providers_funnyordiecom":

"0","oembed_enabled_providers_photobucketcom":"0","oembe

d_enabled_providers_polldaddycom":"0","pick_post_status"

:

["publish"],"boolean_format_type":"checkbox","boolean_ye

s_label":"Yes","boolean_no_label":"No","admin_only":"0",

"restrict_role":"0","restrict_capability":"0","hidden":"

0","read_only":"0","roles_allowed":

["administrator"],"rest_read":"0","rest_write":"0","rest

_pick_response":"array","rest_pick_depth":"2","unique":"

0"},"address":

{"id":1222,"name":"address","label":"GoogleMapLink","des

cription":"","help":"","class":"","type":"text","weight"

:5,"pick_object":"","pick_val":"","sister_id":"","requir

ed":"0","text_allow_shortcode":"1","text_allow_html":"1"

,"text_allowed_html_tags":"strong em a ul ol li b 

i","text_max_length":"255","oembed_enabled_providers_fun

nyordiecom":"0","oembed_enabled_providers_photobucketcom

":"0","oembed_enabled_providers_polldaddycom":"0","pick_

post_status":

["publish"],"admin_only":"0","restrict_role":"0","restri

ct_capability":"0","hidden":"0","read_only":"0","roles_a

llowed":

["administrator"],"rest_read":"0","rest_write":"0","rest

_pick_response":"array","rest_pick_depth":"2","unique":"

0","text_repeatable":"0","text_placeholder":""}},"show_i

n_menu":1,"pfat_enable":"1","pfat_run_outside_loop":"0",

"pfat_single":"rentals","pfat_append_single":"replace","

pfat_filter_single":"the_content","pfat_append_archive":

"append","pfat_filter_archive":"the_content","rest_enabl

e":"0","read_all":"0","write_all":"0"}},"templates":

{"rentals":{"id":1003,"name":"rentals","code":"\t\t\r\n

[before]<table>\r\n\r\n<tr bgcolor=\"#A09D7E

\"><td><b>Date Available<\/b><\/td><td><b>Community \/ 

Model<\/b><\/td><td><b>Description<\/b><

\/td><td><b>Rent<\/b><\/td><\/tr>[\/before]\r\n\r\n\t\t

\r\n[if rent]\r\n<tr><td>{@date-available}<\/td>\r\n

\t<td><a href=\"{@permalink}\">{@community}<\/a><br>

{@address}<\/td>\r\n<td>{@detail}<\/td>\r\n<td>{@rent}<

\/td><\/tr>\r\n[else]\r\n<tr><td><\/td>\r\n\t<td><\/td>

\r\n<td width=\"40%\">{@detail}<\/td>\r\n<td><\/td><

\/tr>\r\n[\/if]\r\n\r\n[after]<\/table>[\/after]\r\n\r

\n聽\t\t\t\t\t\t\t\t

\t","type":"template","slug":"rentals","options":

{"_edit_last":"2","_edit_lock":"1557318114:2","admin_onl

y":"","restrict_capability":"","capability_allowed":"","

pod_reference":"a:1:{s:3:\"pod\";s:4:\"post

\";}"}},"All":{"id":1215,"name":"All","code":"\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

\r\n[before]<div><table><tr><td width=\"50%\">This page 

shows the complete unit list, both available and rented. 

To see only current availability, click \"Home\" 

above.<\/td><td width=\"50%\" colspan=\"2\">To view the 

main community page or browse by location and unit, 

mouse-over \"Location\" in the main navigation and 

select an individual community and then mouse-over

\/browse to the unit name.<\/td><\/tr>\r\n\r\n<tr 

bgcolor=\"#A09D7E\" height=\"100%\"><td><b>Community \/ 

Model<\/b><\/td><td><b>Description<\/b><

\/td><td><b>Click for Map<\/b><\/td><\/tr>[\/before]\r

\n\r\n[if rent]\r\n<tr><td><a href=\"{@permalink}\">

{@community}<\/a><\/td>\r\n<td>{@detail}<\/td><td>

{@address}<\/td>\r\n<\/tr>\r\n[else][\/if]\r\n\r\n\r\n

[after]<\/table>[\/after]\r\n\r\n聽\t\t\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

\t","type":"template","slug":"all","options":

{"_edit_last":"2","_edit_lock":"1530965034:2","admin_onl

y":"","restrict_capability":"","capability_allowed":"","

pod_reference":"a:1:{s:3:\"pod\";s:4:\"post

\";}"}},"test":

{"id":1373,"name":"test","code":"[before]<table>\r\n\r

\n<tr bgcolor=\"#A09D7E\"><td><b>Date Available<\/b><

\/td><td><b>Community \/ Model<\/b><

\/td><td><b>Description<\/b><\/td><td><b>Rent<\/b><

\/td><\/tr>[\/before]\r\n\r\n\t\t\r\n[if rent]\r

\n<tr><td>{@date-available}<\/td>\r\n\t<td><a href=

\"{@permalink}\">{@community}<\/a><br>{@address}<\/td>

\r\n<td>{@detail}<\/td>\r\n<td>{@rent}<\/td><\/tr>\r\n

[else]\r\n<tr><td><\/td>\r\n\t<td><\/td>\r\n<td width=

\"40%\">{@detail}<\/td>\r\n<td><\/td><\/tr>\r\n[\/if]\r

\n\r\n[after]<\/table>[\/after]\r

\n","type":"template","slug":"test","options":

{"_edit_last":"2","admin_only":"","restrict_capability":

"","capability_allowed":"","_edit_lock":"1557321129:2","

pod_reference":"a:1:{s:3:\"pod\";s:4:\"post

\";}"}},"inside":

{"id":1376,"name":"inside","code":"<tr><td>{@date-

available}<\/td>\r\n\t<td><a href=\"{@permalink}\">

{@community}<\/a><br>{@address}<\/td>\r\n<td>{@detail}<

\/td>\r\n<td>{@rent}<\/td><

\/tr>","type":"template","slug":"inside","options":

{"_edit_lock":"1557319466:2","_edit_last":"2","admin_onl

y":"","restrict_capability":"","capability_allowed":"","

pod_reference":"a:1:{s:3:\"pod\";s:0:\"\";}"}}}}

Workaround or Alternate Solution Until Bug is Addressed


Related Issues and/or PRs

Could not reproduce Bug

Most helpful comment

Issue-Label Bot is automatically applying the label Type: Bug to this issue, with a confidence of 0.78. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 2 comments

Issue-Label Bot is automatically applying the label Type: Bug to this issue, with a confidence of 0.78. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@neilsinger I just imported this locally and tested. All three shortcodes work perfectly fine on the Twenty-Nineteen theme. I'm sure we probably asked, but did you do a Conflict Test?

https://docs.pods.io/faqs/plugin-theme-conflicts/

All three of those shortcodes respond properly, calling your template and sorting by date.

Was this page helpful?
0 / 5 - 0 ratings