<p>The developer recently added multiple types of import - Entry, User and Category. </p>

<p>Your import history in the database saved prior to this recent update - I think the db table is called craft_import_history or similar - doesn't have a type saved against so an error is being thrown.</p>

<p>Edit the rows in that table directly and either delete them or edit the type column and add the correct value.</p>

CC BY-SA 3.0
2014-09-21T17:00:03.853Z
2014-09-21T17:00:03.853Z
Jamie Pittock
<p>Getting error</p>

<pre><code>"Craft\Import_HistoryRecord and its behaviors do not have a method or closure named "type".  
</code></pre>

<p><code>Import_HistoryRecord</code> is one of the Plugin Files in the "records" folder.</p>

<pre><code>&lt;?php
namespace Craft;

class Import_HistoryRecord extends BaseRecord
{

    public function getTableName()
    {
        return 'import_history';
    }

    protected function defineAttributes()
    {
        return array(
            'type'     =&gt; AttributeType::String,
            'file'     =&gt; AttributeType::Name,
            'rows'     =&gt; AttributeType::Number,
            'behavior' =&gt; array(AttributeType::Enum, 'values' =&gt; array(ImportModel::BehaviorAppend, ImportModel::BehaviorReplace, ImportModel::BehaviorDelete)),
            'status'   =&gt; array(AttributeType::Enum, 'values' =&gt; array(ImportModel::StatusStarted, ImportModel::StatusFinished, ImportModel::StatusReverted))
        );
    }

    public function defineRelations()
    {
        return array(
            'user' =&gt; array(static::BELONGS_TO, 'UserRecord',       'onDelete' =&gt; static::CASCADE, 'required' =&gt; false),
            'log'  =&gt; array(static::HAS_MANY,   'Import_LogRecord', 'logId')
        );
    }

}
</code></pre>

<p>It worked a month ago when I used it, don't think I am doing anything differently.</p>

<import><plugin-import>
Import Plugin Error
# Import Plugin Error

(Asked by: username_0 on 2014-09-21)

Getting error
"Craft\Import_HistoryRecord and its behaviors do not have a method or closure named "type".  

Import_HistoryRecord is one of the Plugin Files in the "records" folder.
 AttributeType::String,
            'file'     => AttributeType::Name,
            'rows'     => AttributeType::Number,
            'behavior' => array(AttributeType::Enum, 'values' => array(ImportModel::BehaviorAppend, ImportModel::BehaviorReplace, ImportModel::BehaviorDelete)),
            'status'   => array(AttributeType::Enum, 'values' => array(ImportModel::StatusStarted, ImportModel::StatusFinished, ImportModel::StatusReverted))
        );
    }

    public function defineRelations()
    {
        return array(
            'user' => array(static::BELONGS_TO, 'UserRecord',       'onDelete' => static::CASCADE, 'required' => false),
            'log'  => array(static::HAS_MANY,   'Import_LogRecord', 'logId')
        );
    }

}

It worked a month ago when I used it, don't think I am doing anything differently.

**Tags:** import, plugin-import

---

## 1 answers

### Answer by username_1 on 2014-09-21. Score: 1 | Accepted answer

The developer recently added multiple types of import - Entry, User and Category.

Your import history in the database saved prior to this recent update - I think the db table is called craft\_import\_history or similar - doesn't have a type saved against so an error is being thrown.

Edit the rows in that table directly and either delete them or edit the type column and add the correct value.


---

