-
-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix non-existent snippet tags being broken up by an @ tag #16322
base: 3.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,19 +726,14 @@ public function getPropertySet($setName = null) | |
{ | ||
$propertySet = null; | ||
$name = $this->get('name'); | ||
if (strpos($name, '@') !== false) { | ||
$psName = ''; | ||
$split = xPDO:: escSplit('@', $name); | ||
if ($split && isset($split[1])) { | ||
$name = $split[0]; | ||
$psName = $split[1]; | ||
$filters = xPDO:: escSplit(':', $setName); | ||
if ($filters && isset($filters[1]) && !empty($filters[1])) { | ||
$psName = $filters[0]; | ||
$name .= ':' . $filters[1]; | ||
} | ||
$this->set('name', $name); | ||
} | ||
|
||
$nameSplit = explode(':', $name); | ||
$tagName = array_shift($nameSplit); | ||
$remainingTag = implode(':', $nameSplit); | ||
if (strpos($tagName, '@') !== false) { | ||
$split = xPDO:: escSplit('@', $tagName); | ||
$psName = $split[1]; | ||
$this->set('name', $split[0] . $remainingTag); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this is where the issue lies (same goes in the modTag file L520). Here, when modifiers are present, you end up with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A couple other things:
|
||
if (!empty($psName)) { | ||
$psObj = $this->xpdo->getObjectGraph(modPropertySet::class, '{"Elements":{}}', [ | ||
'Elements.element' => $this->id, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the test that's failing. The snippet returns the value of the
prop
property, which doesn't exist in this scenario, so the snippet returns an empty value. That should make it return thedefault
filter, but instead it returns nothing at all (This is a
).Can reproduce the same behavior when creating things manually on a template/resource, so that suggests something is broken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a chance this may've been related to #16337, so will need to test again.