Open HitmanInWis opened 4 months ago
Hi Brett, I cannot reproduce the issue. My tries:
/content/we-retail/us/jcr:content
node's jcr:title
property value to empty. After pulling the /content/we-retail/us/.content.xml
file, the value is correct: jcr:title=""
.value
property with an empty value to the same node. After pulling, I have value=""
in .content.xml
file.I'm using IntelliJ IDEA 2024.1 on macOS.
Could you please provide the exact steps to reproduce? Is \0
added in each case?
Also, could you please try downloading a package with such a problematic node, unpack it somewhere and add a file with an empty property value to the project, and see if it is \0
? In this case, the problem would be on the AEM side, not the plugin.
I am on Windows. Using the WCM Core Carousel component dialog as an example, if I sync it back from CRX on a default AEM Cloud Service SDK from /libs/core/wcm/components/carousel/v1/carousel I get the following:
<activeSelect
jcr:primaryType="nt:unstructured"
sling:resourceType="/libs/granite/ui/components/coral/foundation/form/select"
fieldDescription="The item that is active by default."
fieldLabel="Active Item">
<granite:data
jcr:primaryType="nt:unstructured"
cmp-carousel-v1-dialog-edit-hook="activeSelect"/>
<items jcr:primaryType="nt:unstructured">
<default
jcr:primaryType="nt:unstructured"
text="Default"
value="\0"/>
</items>
</activeSelect>
Side note, working on Windows, another issue I'm getting is that sometimes after I pull files from CRX with the plugin the IDE sees me as changing files that are unchanged except for the source file has CRLF (windows) endings but the updated file has LF (unix) endings. I wonder if it's a similar issue to this one.
@karollewandowski were you ever able to debug this issue? the \0
issue is definitely one challenge I'm facing on a Windows machine, but an even bigger issue is the one I mentioned above where it seems the plugin is printing the file contents with unix style line feeds which makes my windows machine think every line of the file has changed from the code repository version.
@HitmanInWis, not yet. I'll investigate it as the next task.
If you could also check this:
Also, could you please try downloading a package with such a problematic node, unpack it somewhere and add a file with an empty property value to the project, and see if it is \0? In this case, the problem would be on the AEM side, not the plugin.
We have Windows users, and nobody reported this issue, so it's a bit suspicious.
If you could also check this:
I'm replicating this by:
_cq_dialog/.content.xml
file: <accessibilityPlay
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldDescription="Value of an aria-label attribute for the carousel navigation's play button label."
fieldLabel="Play"
name="./accessibilityPlay"
value="\0"/>
<accessibilityPause
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldDescription="Value of an aria-label attribute for the carousel navigation's pause button label."
fieldLabel="Pause"
name="./accessibilityPause"
value="\0"/>
<accessibilityTablist
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldDescription="Value of an aria-label attribute for the carousel navigation's list of items label."
fieldLabel="Tablist"
name="./accessibilityTablist"
value="\0"/>
I understand this is pulled with the plugin. I mean testing a package with building it and downloading manually, directly on AEM, without AEM IDE.
AEM IDE uses the package manager under the hood, and if the same issue occurs when you build and download the package with this node manually, we can be sure that it is your AEM instance configuration issue, not the plugin.
Ahh good call, @karollewandowski. I built a package in package manager, unzipped the package, and opened it in IntelliJ and I see the same value="\0"
items. No idea why it's happening, but this confirms it's not the plugin :)
Should we close this issue then, and open a new one for the Windows vs Unix line feeds?
Thank you for checking. I tried to google something about AEM or Sling settings but found nothing useful.
I just thought that maybe you run AEM locally in a Linux container like Docker or in WSL (I am not sure if this is possible - I'm not familiar with Windows) and there is a discrepancy in encoding.
Regarding line feeds, this sounds like a similar problem. I understand that it doesn't happen in the package downloaded without the plugin, correct? If so, it is really strange. Let's keep it in this issue.
I'm running AEM directly with java from the Windows command line, so no unix containers invovlved.
Looking at the docs on https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/developing/devtools/ht-vlttool it seems vlt
is supposed to convert to CRLF automatically on Windows machines. I assume the plugin is using vlt behind the scenes? Is the plugin rewriting the content at all, where the plugin would be writing line endings?
No, the plugin does not use vlt
. It uses the Package Manager mechanism. It downloads the ZIP from AEM, unpacks it and copies files to the project. It rewrites the content only in the scope of potential reformatting or deleting junk properties.
Thanks Karol. I tested today by pulling a content package from CRX for one of my custom components in my codebase. When I download the package and copy the files in Windows Explorer over the top of my own files, I see that the line endings from AEM are LF
and thus showing as changed, similar to what I'm seeing with the plugin.
This being the case, the plugin may need the option to rewrite files to CRLF format for windows users. As mentioned in vlt
docs, this is something vlt
already does. Though the plugin chooses a different method of pulling the content to the codebase, ideally it would handle this the same as vlt
.
On sync of XML files from CRX where a property is an empty string "", it is synced locally to a "\0" string.
e.g.
value=""
becomesvalue="\0"