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

Phantom macros added upon creating a new Partial View Macro when Umbraco Forms is installed #814

Closed
kinless opened this issue Jul 13, 2022 · 7 comments

Comments

@kinless
Copy link

kinless commented Jul 13, 2022

Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9

10.0.1

Bug summary

Additional Partial View Macro Files are being generated when creating a new Partial View Macro File. They appear to be related to Umbraco.Forms which is also currently installed.

Specifics

Umbraco Forms 10.0.4 is installed.

In Settings, when creating a new Partial View Macro file (with accompanying macro type), two additional Partial View Macro files are generated: "InsertUmbracoFormWithTheme.cshtml" and "RenderUmbracoFormScripts.cshtml". I don't know why those show up. If I click on either one it shows the red 404 error banner, I don't get the "..." option for either one so I can't delete them. I checked the physical path directory and neither file exists.

I deleted my original Partial View Macro, created a directory within the Partial View Macro Files directory and added a new Partial View Macro within the directory. Once again the two additional Form macros show up. Can't access or delete either of them.

These are contaminating my structure and I don't know how to get rid of them. They shouldn't even be showing up in the first place.

Steps to reproduce

  1. Install Forms
  2. Create new Partial View Macro Files
  3. Two additional unwanted Partial View Macros appear
    phantom_macro

Expected result / actual result

I expect only the intended Partial View Macro I created to appear.

@AndyButland
Copy link

AndyButland commented Jul 13, 2022

I'll move this issue over to the Forms tracker, as the problem needs resolving there.

For background though, what's happening here is that we ship two partial views as part of a razor class library with Umbraco Forms. And they need to be selectable via the macro settings partial view picker, which uses a tree. So Forms adds them to this tree so they can be selected.

What I've missed though is of course doing this will also list them in the main Partial View Macros Files tree, where they don't need to be (and certainly shouldn't be in the nested folders). Will look at finding a way to resolve this.

@AndyButland AndyButland transferred this issue from umbraco/Umbraco-CMS Jul 13, 2022
@kinless
Copy link
Author

kinless commented Jul 13, 2022

@AndyButland thank you for the explanation. I figured those two files were part of the Umbraco.Forms package, which I haven't really delved into yet (just installed it last week).

Maybe as a workaround I'll try and put a dummy razor class file in the physical location of the nested directory and see if the reference(s) can be deleted from the backoffice that way, unless you advise against it lest it might nerf the Forms package with fatal errors.

@AndyButland
Copy link

You won't be able to delete them I'm afraid... as we've implemented a tree notification handler in the Forms package to add them. I'll arrange a patch release to fix this up.

@AndyButland
Copy link

Due in 10.0.5.

@AndyButland
Copy link

You'll find a patch release 10.0.5 on NuGet now.

@kinless
Copy link
Author

kinless commented Jul 15, 2022

@AndyButland installed 10.0.5 and can confirm the Form Macro View files are gone from the tree. Many thanks and H5YRs!

@AndyButland
Copy link

Good to hear! And thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants