Answers.Body: <p><a href="https://github.com/craftcms/feed-me/pull/566" rel="nofollow noreferrer">There is a PR</a> to fix this, in the meantime, you can add <code>use craft\feedme\events\ElementEvent;</code> at the top of <code>vendor/craftcms/feed-me/src/base/Element.php</code> </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-24T09:57:08.937Z
Answers.Text: Thanks Oli, annoying little bug this one!
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-24T06:57:26.950Z
Answers.LastActivityDate: 2019-06-24T06:57:26.950Z
Answers.UserDisplayName: Oli
Body: <p>I have the following Module loaded into my system, following the Event's on the FeedMe documentation I've implemented the following to change the slug per entry import but unfortunately, it's returning a strange error that I just can't fix.</p>
  
  <p>Here's the module:</p>
  
  <pre><code>&lt;?php
  
  namespace modules;
  
  use Craft;
  
  use craft\feedme\base\Element;
  use craft\feedme\events\ElementEvent;
  use craft\feedme\services\Process;
  use craft\feedme\events\FeedProcessEvent;
  
  
  use yii\base\Event;
  
  use craft\helpers\ElementHelper;
  use craft\elements\Category;
  use craft\elements\Entry;
  
  class TitleChangerModule extends Module
  {
      public function init()
      {
          parent::init();
          Event::on(
            Process::class,
            Process::EVENT_STEP_BEFORE_ELEMENT_SAVE,
            function(FeedProcessEvent $event) {
              switch($event-&gt;feed['name']){
                  case 'merchants':
                      $element = $event-&gt;element;
                      $element-&gt;slug = ElementHelper::createSlug($element-&gt;title.' '.'Coupon Codes &amp; Promo Codes');
                      break;
              }
          });
      } // Close Public Function
  } // Close Module Off
  </code></pre>
  
  <p>It returns the following error on each import via the feedme logs.</p>
  
  <blockquote>
    <p>Class 'craft\feedme\base\ElementEvent' not found - Element.php: 58</p>
  </blockquote>
  
Tags: <craft3><plugins><plugin-feedme><modules>
Title: Modifying Slug on FeedMe Import
ThreadText: # Modifying Slug on FeedMe Import
  
  (Asked by: username_0 on 2019-06-23)
  
  I have the following Module loaded into my system, following the Event's on the FeedMe documentation I've implemented the following to change the slug per entry import but unfortunately, it's returning a strange error that I just can't fix.
  
  Here's the module:
  
  ```
  <?php
  
  namespace modules;
  
  use Craft;
  
  use craft\feedme\base\Element;
  use craft\feedme\events\ElementEvent;
  use craft\feedme\services\Process;
  use craft\feedme\events\FeedProcessEvent;
  
  use yii\base\Event;
  
  use craft\helpers\ElementHelper;
  use craft\elements\Category;
  use craft\elements\Entry;
  
  class TitleChangerModule extends Module
  {
      public function init()
      {
          parent::init();
          Event::on(
            Process::class,
            Process::EVENT_STEP_BEFORE_ELEMENT_SAVE,
            function(FeedProcessEvent $event) {
              switch($event->feed['name']){
                  case 'merchants':
                      $element = $event->element;
                      $element->slug = ElementHelper::createSlug($element->title.' '.'Coupon Codes & Promo Codes');
                      break;
              }
          });
      } // Close Public Function
  } // Close Module Off
  
  ```
  
  It returns the following error on each import via the feedme logs.
  
  > Class 'craft\feedme\base\ElementEvent' not found - Element.php: 58
  
  **Tags:** craft3, plugins, plugin-feedme, modules
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-24. Score: 2 | Accepted answer
  
  [There is a PR](https://github.com/craftcms/feed-me/pull/566) to fix this, in the meantime, you can add `use craft\feedme\events\ElementEvent;` at the top of `vendor/craftcms/feed-me/src/base/Element.php`
  
  > **Comments:**
  > **username_0**: Thanks Oli, annoying little bug this one!  
  
  ---
  
  