Answers.Body: <p>Something on the <code>$entryToSave</code> EntryModel is failing validation.  If you 
  echo out <code>implode(', ', $entryToSave()-&gt;getAllErrors());</code>, then you'll see what those errors are and you can correct them.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T22:01:07.860Z
Answers.Text: That helped! It was balking on a required field. Just to be clear, if a required field is not explicitly set, even though it was set in existing entry I'm assigning to the entryToSave, I'll still get that error? I resolved it by temporarily setting those fields as not required for the section. Thanks, Brad!
Answers.UserDisplayName: Mark J. Reeves
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T19:56:12.813Z
Answers.LastActivityDate: 2015-12-02T19:56:12.813Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm using code I've been using to update existing entries for a while now and it's failing to fire following the 2.5 upgrade. Trying to figure out what might have changed, or if there's something I'm overlooking. I'm consistently getting the "not saved" response and seeing no update in the entry. <code>showInInvestmentAdvisersReference</code> is the new field I'm setting. I've got <code>limit=1</code> set for testing purposes.</p>
  
  <pre><code>$entries = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
  $entries-&gt;section = 'referenceMaterials';
  $entries-&gt;limit = 1;
  
  $existingEntries = $entries-&gt;find();
  
  foreach ($existingEntries as $existingEntry) {
      echo 'id: ' . $existingEntry-&gt;id . '&lt;br /&gt;';
  
      $entryToSave = new EntryModel();
  
      $entryToSave = $existingEntry;
  
      // Setting these in case they're required to be set for saveEntry()
      $entryToSave-&gt;sectionId = 9;
      $entryToSave-&gt;typeId = 9;
      $entryToSave-&gt;authorId = 1;
      $entryToSave-&gt;enabled = true;
      $entryToSave-&gt;getContent()-&gt;title = $existingEntry-&gt;title;
  
      $entryToSave-&gt;getContent()-&gt;showInInvestmentAdvisersReference = 1;
  
      if ( craft()-&gt;entries-&gt;saveEntry($entryToSave) )
      {
          echo 'saved&lt;br /&gt;';
      }
      else {
          echo 'not saved&lt;br /&gt;';
      }
  }
  </code></pre>
  
  <p>Is it me? Did something change? Happy to file a bug report but thought I'd start here first where code formatting is supported.</p>
  
Tags: <plugin-elementapi><services><saveentry>
Title: saveEntry() not firing
ThreadText: # saveEntry() not firing
  
  (Asked by: username_0 on 2015-12-02)
  
  I'm using code I've been using to update existing entries for a while now and it's failing to fire following the 2.5 upgrade. Trying to figure out what might have changed, or if there's something I'm overlooking. I'm consistently getting the "not saved" response and seeing no update in the entry. `showInInvestmentAdvisersReference` is the new field I'm setting. I've got `limit=1` set for testing purposes.
  
  ```
  $entries = craft()->elements->getCriteria(ElementType::Entry);
  $entries->section = 'referenceMaterials';
  $entries->limit = 1;
  
  $existingEntries = $entries->find();
  
  foreach ($existingEntries as $existingEntry) {
      echo 'id: ' . $existingEntry->id . '<br />';
  
      $entryToSave = new EntryModel();
  
      $entryToSave = $existingEntry;
  
      // Setting these in case they're required to be set for saveEntry()
      $entryToSave->sectionId = 9;
      $entryToSave->typeId = 9;
      $entryToSave->authorId = 1;
      $entryToSave->enabled = true;
      $entryToSave->getContent()->title = $existingEntry->title;
  
      $entryToSave->getContent()->showInInvestmentAdvisersReference = 1;
  
      if ( craft()->entries->saveEntry($entryToSave) )
      {
          echo 'saved<br />';
      }
      else {
          echo 'not saved<br />';
      }
  }
  
  ```
  
  Is it me? Did something change? Happy to file a bug report but thought I'd start here first where code formatting is supported.
  
  **Tags:** plugin-elementapi, services, saveentry
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-02. Score: 3 | Accepted answer
  
  Something on the `$entryToSave` EntryModel is failing validation. If you
  echo out `implode(', ', $entryToSave()->getAllErrors());`, then you'll see what those errors are and you can correct them.
  
  > **Comments:**
  > **username_0**: That helped! It was balking on a required field. Just to be clear, if a required field is not explicitly set, even though it was set in existing entry I'm assigning to the entryToSave, I'll still get that error? I resolved it by temporarily setting those fields as not required for the section. Thanks, username_1!  
  
  ---
  
  