Jump to content

Hardcoded column name in Colorize nodes


Adriano Faria

Recommended Posts

Posted

I'm trying to use the Colorize Node feature in my apps but I'm getting on streams:

Quote

SELECT `rc_id`, `rc_name_furl`, `feature_color` FROM `raffles_categories` WHERE ( rc_id IN(1) )
IPS\Db\Exception: Unknown column 'feature_color' in 'field list' (1054)

That's because you hardcoded the column name in IPS\Node\Colorize to be used in FORUMS app only.

/**
 * Colorize Trait
 */
trait Colorize
{
	/**
	 * @brief	Table column name that holds the feature color hex
	 */
	public static $featureColumnName = 'feature_color';

If I rename my column to remove the table prefix, then it works:

ZsK96UE.png

But that's not right. It should've been done like reaction, where you pass the ID.

  • 4 weeks later...
  • 3 months later...
  • 1 month later...
  • 2 weeks later...
Posted

That's not really a big deal. Sure it's not the best setup, but it's minor compared to other areas I run into, such as methods where there's no way to do something without totally overwriting a large method, such as during the content item creation process.

Archived

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

  • Recently Browsing   0 members

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