onBeforeSaveEntry is hanging on import I am using the Import plugin. This question doesn't have to do with the Import plugin which seems to be working swell, but instead with my onBeforeSaveEntry logic which seems to have botched the import process.

public function init()
{
    parent::init();

    craft()-&gt;on('entries.onBeforeSaveEntry', function(Event $event)
    {

        if($params['isNewEntry']) {

            $entry = $event-&gt;params['entry'];

            $criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::User);
            $criteria-&gt;groupId = 1;
            $criteria-&gt;AffiliateId = $entry['AffiliateId']; 
            $criteria-&gt;limit = 1;
            $users = $criteria-&gt;find();

            if (!empty($users)) {           
                $assignedCoach = $users[0]-&gt;id;
                $entry-&gt;authorId = $assignedCoach;
                $entry-&gt;getContent()-&gt;coachId = $assignedCoach;
            }
        }        
    });

}


What am I doing wrong here? Also, any idea how I kill the import processes which seem to be hung at the moment?
Your script probably chokes because you're interacting with an undeclared variable $params – i.e. change

if($params['isNewEntry']) {


to

if($event-&gt;params['isNewEntry']) {