Skip to content

Conversation

@colorwebdesigner
Copy link

What does it do?

Fixes SQL syntax generation in resourcelist TV render when:

  • where parameter contains complex JSON conditions (e.g., [{"published":"1"}, {"hidemenu":"0"}])
  • Used in MIGx configurations with direct JSON input
  • Maintains compatibility with standard MODX TV settings

Why is it needed?

  • Prevents SQL errors when resourcelist TV uses array-style where conditions
  • Critical for MIGx configurations where TV parameters are defined via JSON
  • Original bug: Broken SQL query when where contains nested objects

How to test

The error was observed in MODx version 2.8.8-pl
1. Configuration for resourcelist TV in MIGx

{"allowBlank":1,"showNone":1,"parents":"1,2,3","includeParent":1,"where":[{"published":"1"},{"hidemenu":"0"}],"limit":"0"}

Verify:

  • Resources load without SQL errors in MIGxDB interface (?a=index&namespace=migx&configs=...)
  • Filters by published=1 and hidemenu=0 are applied correctly

2. Standard MODX TV:

  • Create TV with resourcelist input type
  • Set "Where Conditions" to:
  [{"published":"1"}, {"hidemenu":"0"}]

Check resource selection in manager.

- Fixes SQL syntax error when `where` parameter is empty  
- Preserves backward compatibility with MODX 2.7.x  
- Tested with MIGx, MIGxDB and default configurations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant