Custom tree and application not registering in 4.9
Hi Guys. I am attempting to create a custom application and tree in my site. I've implemented the tree and application.For my tree I've implemented BaseTree and used the Tree attribute on the class to mark it as a tree. For my application I've done the same with IApplication and the application attribute.
When I start my application, everything gets added correctly into the trees.config and applications.config but nothing gets added to the database. Am I correct in assuming that the two config files should also sync to the database?
Hey. Thank you for the reply. Now that I am at my workstation i can provide a bit more information. I have tried restarting the app pool (restarting IIS, restarting the pool, restarting the machine) but none of these options worked. I thew in some test email code just to see if the class ever gets loaded but this also didn't work.
I've enabled debug mode so that I can see if anything is getting logged to the umbracoLog table but nothing shows up. I can pretty much say that my tree classes are being ignored while loading but I'm quite unsure as to why. Thank you!
Looking at the above, I can't see anything specific that would cause your tree not to load. I'd say double check you've recycled your app pool, but I would imaging this should have happened when you dropped the dll in the bin folder.
Have you tried debugging? Do any of the methods on your tree ever get called? Using BaseTree shouldn't be a problem, as that is what all the internal trees are doing, but have you tried just implementing ITree? Could be worth a try to see if anything funky is going on.
Hey Matt. I've tried all sorts of recycling methods and none of them seem to work.
I've tried debugging too but it never makes it into my tree class. Also, I have tried implmenting ITree but I run into the same issue.
Quick question, should I need to specify a namespace or will the TypeFinder find it automatically. If i did have to, would that I specify that in the assembly or the type attribute?
The type is already defined in the XML config, namely the assembly attribute and type attribute, which get combined to represent the namespace of the trees type. I would imagine though, if Umbraco created the config entries, they should be right.
I think it might require some debugging into the Umbraco source to see what is going on and why it's not getting picked up. It's getting late here in the UK, but I'll try creating a similar tree in the morning and see if I can replicate your problem.
Oh wait, have you given the current user access to your application? In the edit user dialog, be sure to give your user permission to your new application.
Ok, I've actually just tested it, and I'm pretty sure it's what I mentioned above. By default, your user won't have access to your application. You have to enable it in the edit user screen for your current user. I just recreated your classes, and enabling this got them both to display.
Thanks Matt. That was my first thought but when I go into the users section, the application doesn't even appear in the sections list. I wonder if the sections list is being cached somehwere.
Dang! that is weird. I just copied exactly what you had and compiled it. Dropped the DLL in the bin folder, restarted the app pool which added the entries to the application / tree configs. Went to user editor and I am able to enable the application for the user and everything just worked. A new app was added to the tray and going to that section loads the tree.
What happens if you just add a entry to your applications.config by hand and restart the app pool? it should get listed in the user editor as a section to enable. If not, then yea, it sounds like you've got something funky going on.
One other condiseration. Should I have to add anything to the lang files. I know this was previosly a step. I'm just trying to figure out if I missed something simple.
This is an upgrade. My fresh install was back at 4.7 so I naturally thought that It was an old library reading the configuration. I've tried replacing the bins with the 4.9.1 but that didn't show any improvement.
I'm completley stumped. It doesn't appear that changing my application.config does anything.
Under normal circumstances, should adding an entry to my applications.config actually show that application right after app pool restart?
After adding to app.config, it should make it available in the user editor to enable straight after an app pool restart.
Out of curiocity, can you try adding an application via the database? rather than the config. Table umbracoApp. It should be the exact same format. If that shows up, then it sounds like you do have a cached assembly. Have you cleared out your temp asp.net files?
Ohh man... I don't belive it myself but it works. Here was the struggle:
Out of curiosity I tried removing section permissions for things like the members section to see if it would refresh the sections list. Oddly enough, rather than unassigning the permission, it removed them from the sections option comtpletley! Despite the fact that my account was an administrator, once I removed the permissions, I could not get them back. My theory at this point was that if unassigned section permissions were invisible, perhaps my application and trees were in the list of invisible sections.
My next step was to log in using the main admin account and see what permissoins we available. Much to my surprise, all of the lost sections were there, including my own custom one.
My final question, as an administrator, should these sections be dissapearing once I remove permissions or should I see them regardless? If they should still be visible then I should probably create a bug ticket for this. As it stands right now, only my main admin account can see sections that have not been assigned to a users.
Thanks again for all of your help. Your help has been invaluable.
Aaaaaaaah! That'll be why it worked ok for me then, as I always log in as Admin. I would imagine that if you are assigned admin role, that those should be available to enable / disable, so I would say to go report it as a bug.
Custom tree and application not registering in 4.9
Hi Guys. I am attempting to create a custom application and tree in my site. I've implemented the tree and application.For my tree I've implemented BaseTree and used the Tree attribute on the class to mark it as a tree. For my application I've done the same with IApplication and the application attribute.
When I start my application, everything gets added correctly into the trees.config and applications.config but nothing gets added to the database. Am I correct in assuming that the two config files should also sync to the database?
Any help would be appreciated. Thank you.
Hi Andrew,
From the U4.9 the custom tree settings has been moved to config. Database tables are still there but no need to sync.
Thanks
PTamang
Hey. Thank you for the reply. Now that I am at my workstation i can provide a bit more information. I have tried restarting the app pool (restarting IIS, restarting the pool, restarting the machine) but none of these options worked. I thew in some test email code just to see if the class ever gets loaded but this also didn't work.
Here is my Tree definition
Here is my Application definition
Here is the relevant line automatically added to my trees.config
Here is the relavant line automaticaly added to my applications.config
I've enabled debug mode so that I can see if anything is getting logged to the umbracoLog table but nothing shows up. I can pretty much say that my tree classes are being ignored while loading but I'm quite unsure as to why. Thank you!
Hey Andrew,
Looking at the above, I can't see anything specific that would cause your tree not to load. I'd say double check you've recycled your app pool, but I would imaging this should have happened when you dropped the dll in the bin folder.
Have you tried debugging? Do any of the methods on your tree ever get called? Using BaseTree shouldn't be a problem, as that is what all the internal trees are doing, but have you tried just implementing ITree? Could be worth a try to see if anything funky is going on.
Matt
Hey Matt. I've tried all sorts of recycling methods and none of them seem to work.
I've tried debugging too but it never makes it into my tree class. Also, I have tried implmenting ITree but I run into the same issue.
Quick question, should I need to specify a namespace or will the TypeFinder find it automatically. If i did have to, would that I specify that in the assembly or the type attribute?
Thanks again for all the help/
Hi Andrew,
The type is already defined in the XML config, namely the assembly attribute and type attribute, which get combined to represent the namespace of the trees type. I would imagine though, if Umbraco created the config entries, they should be right.
I think it might require some debugging into the Umbraco source to see what is going on and why it's not getting picked up. It's getting late here in the UK, but I'll try creating a similar tree in the morning and see if I can replicate your problem.
Cheers
Matt
Oh wait, have you given the current user access to your application? In the edit user dialog, be sure to give your user permission to your new application.
Matt
Ok, I've actually just tested it, and I'm pretty sure it's what I mentioned above. By default, your user won't have access to your application. You have to enable it in the edit user screen for your current user. I just recreated your classes, and enabling this got them both to display.
Hope that helps
Matt
Thanks Matt. That was my first thought but when I go into the users section, the application doesn't even appear in the sections list. I wonder if the sections list is being cached somehwere.
Dang! that is weird. I just copied exactly what you had and compiled it. Dropped the DLL in the bin folder, restarted the app pool which added the entries to the application / tree configs. Went to user editor and I am able to enable the application for the user and everything just worked. A new app was added to the tray and going to that section loads the tree.
What happens if you just add a entry to your applications.config by hand and restart the app pool? it should get listed in the user editor as a section to enable. If not, then yea, it sounds like you've got something funky going on.
Matt
This is very strange. Adding an entry to applications.config does nothing. Even after an IIS reset.
One other condiseration. Should I have to add anything to the lang files. I know this was previosly a step. I'm just trying to figure out if I missed something simple.
Hey Andrew,
You shouldn't do. It should be as simple as defining it in the config file and it should get picked up. Is this a fresh install? or an upgrade?
Matt
This is an upgrade. My fresh install was back at 4.7 so I naturally thought that It was an old library reading the configuration. I've tried replacing the bins with the 4.9.1 but that didn't show any improvement.
I'm completley stumped. It doesn't appear that changing my application.config does anything.
Under normal circumstances, should adding an entry to my applications.config actually show that application right after app pool restart?
Hi Andrew,
After adding to app.config, it should make it available in the user editor to enable straight after an app pool restart.
Out of curiocity, can you try adding an application via the database? rather than the config. Table umbracoApp. It should be the exact same format. If that shows up, then it sounds like you do have a cached assembly. Have you cleared out your temp asp.net files?
Matt
Ohh man... I don't belive it myself but it works. Here was the struggle:
Out of curiosity I tried removing section permissions for things like the members section to see if it would refresh the sections list. Oddly enough, rather than unassigning the permission, it removed them from the sections option comtpletley! Despite the fact that my account was an administrator, once I removed the permissions, I could not get them back. My theory at this point was that if unassigned section permissions were invisible, perhaps my application and trees were in the list of invisible sections.
My next step was to log in using the main admin account and see what permissoins we available. Much to my surprise, all of the lost sections were there, including my own custom one.
My final question, as an administrator, should these sections be dissapearing once I remove permissions or should I see them regardless? If they should still be visible then I should probably create a bug ticket for this. As it stands right now, only my main admin account can see sections that have not been assigned to a users.
Thanks again for all of your help. Your help has been invaluable.
Hey Andrew,
Aaaaaaaah! That'll be why it worked ok for me then, as I always log in as Admin. I would imagine that if you are assigned admin role, that those should be available to enable / disable, so I would say to go report it as a bug.
Glad you managed to get it working though.
Matt
I've encountered this issue too, after having upgraded from 4.7.0 to 6.0.2. I've added a comment to the issue with a screencast reproducing the steps.
I've also encountered this bug. The application won't register
Great post here by Andrew Aitken for creating trees in Umbraco 6 (and 4.8+)
http://andrewaitken.com/2013/07/creating-a-custom-section-in-umbraco-6-part-1-the-application/
http://andrewaitken.com/2013/07/creating-a-custom-section-in-umbraco-6-part-2-the-tree/
is working on a reply...