Jump to content

Content Container Assumptions


HeadStand

Recommended Posts

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. :( 

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...