Skip to content
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

Fusion remove last use of copy path. #3588

Closed
mhsdesign opened this issue Feb 1, 2022 · 1 comment · Fixed by #3654
Closed

Fusion remove last use of copy path. #3588

mhsdesign opened this issue Feb 1, 2022 · 1 comment · Fixed by #3654

Comments

@mhsdesign
Copy link
Member

This line still holds on to the last used copy path operation - and we should find a better way of handling this usecase.

attributes.class.@process < prototype(Neos.Neos:Content).attributes.class.@process

its copied from

# The following is used to automatically append a class attribute that reflects the underlying node type of a Fusion object,
# for example "neos-nodetypes-form", "neos-nodetypes-headline", "neos-nodetypes-html", "neos-nodetypes-image", "neos-nodetypes-menu" and "neos-nodetypes-text"
# You can disable the following line with:
# prototype(Neos.Neos:Content) {
# attributes.class.@process.nodeType >
# }
# in your site's Fusion if you don't need that behavior.
attributes.class.@process.nodeType = Neos.Fusion:Case {
@context.nodeTypeClassName = ${String.toLowerCase(String.pregReplace(q(node).property('_nodeType.name'), '/[[:^alnum:]]/', '-'))}
classIsString {
condition = ${Type.isString(value)}
renderer = ${String.trim(String.trim(value) + ' ' + nodeTypeClassName)}
}
classIsArray {
condition = ${Type.isArray(value)}
renderer = ${Array.push(value, nodeTypeClassName)}
}
}

one could even argue - this thing has no 'justified' usecase : P

mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this issue Mar 23, 2022
with: neos/flow-development-collection#2710

we can add any scalar types to Array.push as base, which will be auto casted to an array:
`Array.push("foo", "bar")`
which results in -> `["foo", "bar"]`
which is rendered as `foo bar`

previously we had to cast it to an array beforehand. I integrated this for the 'neos-contentcollection' once: neos#3438 - but this cleans the manual cast up.

(this also fixes any real low level css class adding via `Type.isString()` etc by just casting to an array and then pushing the new value.)

Also the last use of copy will be removed, by manually copying the (now little) code over.
fixes: neos#3588
mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this issue Mar 23, 2022
with: neos/flow-development-collection#2710

we can add any scalar types to Array.push as base, which will be auto casted to an array:
`Array.push("foo", "bar")`
which results in -> `["foo", "bar"]`
which is rendered as `foo bar`

previously we had to cast it to an array beforehand. I integrated this for the 'neos-contentcollection' once: neos#3438 - but this cleans the manual cast up.

(this also fixes any real low level css class adding via `Type.isString()` etc by just casting to an array and then pushing the new value.)

Also the last use of copy will be removed, by manually copying the (now little) code over.
fixes: neos#3588
@mhsdesign
Copy link
Member Author

horray ^^

neos-bot pushed a commit to neos/neos that referenced this issue Mar 24, 2022
with: neos/flow-development-collection#2710

we can add any scalar types to Array.push as base, which will be auto casted to an array:
`Array.push("foo", "bar")`
which results in -> `["foo", "bar"]`
which is rendered as `foo bar`

previously we had to cast it to an array beforehand. I integrated this for the 'neos-contentcollection' once: neos/neos-development-collection#3438 - but this cleans the manual cast up.

(this also fixes any real low level css class adding via `Type.isString()` etc by just casting to an array and then pushing the new value.)

Also the last use of copy will be removed, by manually copying the (now little) code over.
fixes: neos/neos-development-collection#3588
neos-bot pushed a commit to neos/nodetypes-navigation that referenced this issue Mar 24, 2022
with: neos/flow-development-collection#2710

we can add any scalar types to Array.push as base, which will be auto casted to an array:
`Array.push("foo", "bar")`
which results in -> `["foo", "bar"]`
which is rendered as `foo bar`

previously we had to cast it to an array beforehand. I integrated this for the 'neos-contentcollection' once: neos/neos-development-collection#3438 - but this cleans the manual cast up.

(this also fixes any real low level css class adding via `Type.isString()` etc by just casting to an array and then pushing the new value.)

Also the last use of copy will be removed, by manually copying the (now little) code over.
fixes: neos/neos-development-collection#3588
neos-bot pushed a commit to neos/neos that referenced this issue Oct 7, 2022
with: neos/flow-development-collection#2710

we can add any scalar types to Array.push as base, which will be auto casted to an array:
`Array.push("foo", "bar")`
which results in -> `["foo", "bar"]`
which is rendered as `foo bar`

previously we had to cast it to an array beforehand. I integrated this for the 'neos-contentcollection' once: neos/neos-development-collection#3438 - but this cleans the manual cast up.

(this also fixes any real low level css class adding via `Type.isString()` etc by just casting to an array and then pushing the new value.)

Also the last use of copy will be removed, by manually copying the (now little) code over.
fixes: neos/neos-development-collection#3588
neos-bot pushed a commit to neos/nodetypes-navigation that referenced this issue Oct 7, 2022
with: neos/flow-development-collection#2710

we can add any scalar types to Array.push as base, which will be auto casted to an array:
`Array.push("foo", "bar")`
which results in -> `["foo", "bar"]`
which is rendered as `foo bar`

previously we had to cast it to an array beforehand. I integrated this for the 'neos-contentcollection' once: neos/neos-development-collection#3438 - but this cleans the manual cast up.

(this also fixes any real low level css class adding via `Type.isString()` etc by just casting to an array and then pushing the new value.)

Also the last use of copy will be removed, by manually copying the (now little) code over.
fixes: neos/neos-development-collection#3588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant