HeadStand Posted November 12, 2015 Posted November 12, 2015 I have a custom app that uses Content Items without containers. Everything is great, until I added the ability to delete an item. I end up with a "We could not find the item you are trying to view" error. Eventually found the root cause in \IPS\Content\Controller, line 459. if( \IPS\Request::i()->action == 'delete' ) { \IPS\Output::i()->redirect( $item->container()->url() ); } Can we please stop assuming that everything follows the Container -> Item -> Comment structure? It's extremely frustrating. If containers are supposed to be optional, let's please try and keep them optional. I can provide other examples of where the structure is tied together, if necessary. I've hit this wall more than once, unfortunately.
CodingJungle Posted November 12, 2015 Posted November 12, 2015 odd HS, as i built keywords without using a container and did not run into this. is this on 4.0 or 4.1? (i'll double check keywords to make sure i'm not doing something else as i have overloaded the delete method).
HeadStand Posted November 12, 2015 Author Posted November 12, 2015 34 minutes ago, CodingJungle said: odd HS, as i built keywords without using a container and did not run into this. is this on 4.0 or 4.1? (i'll double check keywords to make sure i'm not doing something else as i have overloaded the delete method). 4.1.3.2. I don't recall this happening before either (in 4.0), but it's definitely there now...
CodingJungle Posted November 12, 2015 Posted November 12, 2015 2 minutes ago, HeadStand said: 4.1.3.2. I don't recall this happening before either (in 4.0), but it's definitely there now... i do recall it acting a bit weird till i added these properties: /** * @brief URL Base */ public static $urlBase = 'app=keywords&module=keywords&controller=view&id='; /** * @brief URL Base */ public static $urlTemplate = 'keywords_list'; /** * @brief SEO Title Column */ public static $seoTitleColumn = 'word'; but other than that, i overload the delete() method, only to ensure the keywords cache gets updated.
Mark Posted November 12, 2015 Posted November 12, 2015 Yes, making the system more abstract is on our list to do for a future version. For now, just overload the moderate() method in your controller.
CodingJungle Posted November 12, 2015 Posted November 12, 2015 while you are at it, can you take a look at the contentRouter language string that assumes there is a container as well, cause: Posted 'keyword' in on the my activity is sorta weird looking :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.