You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Macro Partial View via the backoffice - right click 'Partial View Macro Files' and choose new partial view macro (without macro).
This is a common scenario, where you create the 'Macro' first, but then realise you need to now create the Partial View Macro File... (whereas if you'd created the Partial View Macro File first, you'd have the option to generate the Macro at the same time... possibly the UI for this journey could be tweaked, with the 'Macros' above the 'Partial View Macro Files' it's much more likely you will create the Macro first... anyway I digress.)
When you create the Partial View Macro File you are asked to add the 'Name' the convention for this is that it appears in the Umbraco Tree as this name... but it also sets the underlying filename of the partial view on disk...
... therefore it's quite likely you are thinking 'name' and not 'file name' and you create the name with spaces...
The Macro File Name + Macro File is created on disk with the spaces:
(should at this point the spaces have been stripped in the filename? eg it's ok for filenames to have spaces but it's only going to cause problems...)
Now switch back to the Macro... and pick the Macro File you just created... it appears in the list, but the spaces have been Url Encoded into + characters:
But you can pick it and save the Macro ok... however when you try to insert the macro, the associated Partial View cannot be found...
... because it's looking for a file on disk with plusses in!!
Anyway so there are three different places where this 'could be fixed'...
filename not having spaces
spaces not being url encoded as plusses when the partial is picked
or
turning the encoded plusses back into spaces when looking for the file...
So depends on if we feel we need to support having Macro Partial File Names with spaces?
The text was updated successfully, but these errors were encountered:
It looks like option 2 was the intended solution. The filenames are being URL encoded in C# when populating the options for the picker, and decoded in javascript when an option is picked. But javascript's decoding doesn't decode + to space. PR #6592 fixes that.
Using Umbraco 8.1 + 8.2RC
Create a Macro Partial View via the backoffice - right click 'Partial View Macro Files' and choose new partial view macro (without macro).
This is a common scenario, where you create the 'Macro' first, but then realise you need to now create the Partial View Macro File... (whereas if you'd created the Partial View Macro File first, you'd have the option to generate the Macro at the same time... possibly the UI for this journey could be tweaked, with the 'Macros' above the 'Partial View Macro Files' it's much more likely you will create the Macro first... anyway I digress.)
When you create the Partial View Macro File you are asked to add the 'Name' the convention for this is that it appears in the Umbraco Tree as this name... but it also sets the underlying filename of the partial view on disk...
... therefore it's quite likely you are thinking 'name' and not 'file name' and you create the name with spaces...
The Macro File Name + Macro File is created on disk with the spaces:
(should at this point the spaces have been stripped in the filename? eg it's ok for filenames to have spaces but it's only going to cause problems...)
Now switch back to the Macro... and pick the Macro File you just created... it appears in the list, but the spaces have been Url Encoded into + characters:
But you can pick it and save the Macro ok... however when you try to insert the macro, the associated Partial View cannot be found...
... because it's looking for a file on disk with plusses in!!
Anyway so there are three different places where this 'could be fixed'...
or
So depends on if we feel we need to support having Macro Partial File Names with spaces?
The text was updated successfully, but these errors were encountered: