Hi,

I've implemented the following custom property as shown below.
Creating a new property using varchar255 will add the column in the table. However disabling the new created property did not removed the column from entity table.

However enabling and disabling the default properties will add/remove the columns from entity table just fine.

Mihai,

/**
 * Implemetation of hook_eck_property_types ($type, $schema)
 */
function eckextra_eck_property_types_alter(&$property_types) {
  $property_types['varchar255'] = array(
      'type' => 'varchar255',
      'label' => 'Varchar 255',
      'settings' => array(),
      'class' => 'Varchar255PropertyType',
      'file' => false,
      'description' => '',
  );
class Varchar255PropertyType implements PropertyType {

  public static function schema() {
    $schema = array(
        'description' => 'Varchar',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
    );

    return $schema;
  }

  public static function validate($value) {
    return TRUE;
  }

}

Comments

fmizzell’s picture

Status: Active » Postponed (maintainer needs more info)

I was not able to reproduce the issue. This is what I did:

  1. Added a new property and saved
  2. the new column was in the db
  3. unchecked the box of the new property, clicked saved
  4. checked the db and the column was gone

This could be specific to your custom property (even through I did see anything odd about your code) or something specific about your overall set up.

legolasbo’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (duplicate)

Closing old issues. Please reopen the issue with a clear description and/or steps to reproduce if this issue is still relevant.

legolasbo’s picture

Status: Closed (duplicate) » Closed (cannot reproduce)