Bug #121
TV value for resource inefective in [[snippet@ps]]
| Status: | Resolved | Start date: | ||
|---|---|---|---|---|
| Priority: | Major | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | Core | |||
| Target version: | Revolution-2.2.0-rc-1 | |||
| JiraID: | MODX-2294 | Resolution: | Fixed | |
| Environment: | r7210 | Affects Revolution Version: | Revolution-2.0.4-pl |
Description
In property set for getResources "myps" I defined "[ [*mytv] ]" value for "resources". When the snippet is called with "[ [getResources@myps] ]" the value of "mytv" is not used. I have to use a direct call "[[getResources@myps?resources=`[ [*mytv] ]`]]". I'm not sure whether it's issue with PS in general or getResources?
History
Updated by Shaun McCormick over 1 year ago
- Assignee deleted (
Unknown User)
Updated by gadamiak over 1 year ago
This is still present in 2.0.5-dev. I tested the following values in a property set to no avail:
[[*mytv]][[+mytv]]*mytv+mytvmytv
The actual name ot the TV in case contains a dot and a dash: my.t-v
Updated by Jason Coward over 1 year ago
- Category changed from Elements to Core
- Assignee set to Jason Coward
- Target version set to Revolution-2.1.0-rc-1
- Affects Revolution Version changed from Revolution-2.0.1-pl to Revolution-2.0.4-pl
The current parsing rules for properties work like this when an Element is processed via a tag:
- the tag string is processed, including non-cacheable embedded tags
- the parsed property values from the tag string are merged on top of any PropertySet properties, which is merged on top of the default properties
- the Element content is processed to produce output
So currently, the only way you can get tags into the Element that are not parsed before the Element is, is by putting them in PropertySets (or default properties). And likewise, the only way to have tags parsed before the Element is, is by putting them in the tag string directly. We could fix the "bug" to make it consistent by pre-parsing all default and PropertySet properties before the Element is, but then you would have no way to get tags in that were not pre-processed. Perhaps we could make this a piece of Element metadata which optionally instructed the Element to pre-process all tags in the property values from default properties and Property Sets.
Updated by gadamiak over 1 year ago
I'm not sure I'm getting you right that it's by design? If so, maybe the "uncached trick" could be used to force pre-processing of property? I mean using [[!*tv]] as property value or something similar?
Updated by Ryan Thrash about 1 year ago
- Status changed from Open to Assigned
Updated by Jason Coward about 1 year ago
- Target version changed from Revolution-2.1.0-rc-1 to Revolution-2.2.0-rc-1
I have no solution for this at the time. Pre-processing tags in property set values would break current Elements that expect the current behavior, i.e. the tags to not be processed before being passed to the Element.
Suggestions welcome...
Updated by gadamiak about 1 year ago
Jason Coward wrote:
...Perhaps we could make this a piece of Element metadata which optionally instructed the Element to pre-process all tags in the property values from default properties and Property Sets.
What about that idea?
Updated by Jason Coward about 1 year ago
Ah right, forgot about that — It's still on the table for 2.2.x, I am just afraid that it would not be understood by many users who would turn it on in places that would cause Snippets to seem broken. There are potentially other implications to that as well, affecting output filters and other processing, so I'm not going to rush this into 2.1 which we need to release soon.
Updated by gadamiak about 1 year ago
Right. An informative description will be a must.
Updated by Jason Coward 6 months ago
- Status changed from Assigned to In Progress
- Resolution changed from Unresolved to Confirmed
Updated by Jason Coward 6 months ago
- % Done changed from 0 to 90
- Resolution changed from Confirmed to Fixed
Mostly fixed; currently checkbox on the properties tab does not trigger the form as dirty.
Updated by Jason Coward 6 months ago
- Status changed from In Progress to Resolved
- % Done changed from 90 to 100