Answers.Body: <p>Solution is simple, the field type is a select so I need to change </p>
  
  <p><code>entry.feedLimit</code></p>
  
  <p>to</p>
  
  <p><code>entry.feedLimit.value</code></p>
  
  <p>And then it works</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-16T01:14:25.067Z
Answers.LastActivityDate: 2018-12-16T01:14:25.067Z
Answers.UserDisplayName: CreateSean
Body: <p>I'm processing some feeds using <code>craft.app.feeds.getFeedItems()</code> and it works if I pass the limit as a hard coded number like this:</p>
  
  <pre><code>{% set items = craft.app.feeds.getFeedItems(entry.rssURL, '5') %}
  &lt;ul&gt;
      {% for item in items %}
        &lt;li&gt;&lt;a href="{{ item.permalink }}"&gt;{{ item.title }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %} 
  &lt;/ul&gt;
  </code></pre>
  
  <p>However if I change <code>'5'</code> to a field handle I get errors. where <code>entry.feedLimit</code> is a number such as 3 or 5</p>
  
  <pre><code>{% set items = craft.app.feeds.getFeedItems(entry.rssURL, entry.feedLimit) %}
  &lt;ul&gt;
      {% for item in items %}
        &lt;li&gt;&lt;a href="{{ item.permalink }}"&gt;{{ item.title }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %} 
  &lt;/ul&gt;
  </code></pre>
  
  <p>The errors I get is:</p>
  
  <blockquote>
    <p>TypeError Argument 2 passed to craft\feeds\Feeds::getFeedItems() must
    be of the type integer or null, object given, called in
    /path/to/vendor/twig/twig/lib/Twig/Extension/Core.php
    on line 1619</p>
  </blockquote>
  
  <p>This code was previously working on Craft 2, but after the update it is now broken. I've temporarily hard coded the limit in, but that's not ideal.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-16T01:04:26.933Z
Comments.Text: What type of field is `feedLimit`?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-16T01:13:42.200Z
Comments.Text: it's a select and I solved it by changing code to entry.feedLimit.value
Comments.UserDisplayName: CreateSean
Tags: <templating><craft3><error><feed>
Title: Erros when using Entry Variable in craft.app.feeds.getFeedItems
ThreadText: # Erros when using Entry Variable in craft.app.feeds.getFeedItems
  
  (Asked by: username_0 on 2018-12-16)
  
  I'm processing some feeds using `craft.app.feeds.getFeedItems()` and it works if I pass the limit as a hard coded number like this:
  
  ```
  {% set items = craft.app.feeds.getFeedItems(entry.rssURL, '5') %}
  <ul>
      {% for item in items %}
        <li><a href="{{ item.permalink }}">{{ item.title }}</a></li>
      {% endfor %} 
  </ul>
  
  ```
  
  However if I change `'5'` to a field handle I get errors. where `entry.feedLimit` is a number such as 3 or 5
  
  ```
  {% set items = craft.app.feeds.getFeedItems(entry.rssURL, entry.feedLimit) %}
  <ul>
      {% for item in items %}
        <li><a href="{{ item.permalink }}">{{ item.title }}</a></li>
      {% endfor %} 
  </ul>
  
  ```
  
  The errors I get is:
  
  > TypeError Argument 2 passed to craft\feeds\Feeds::getFeedItems() must
  > be of the type integer or null, object given, called in
  > /path/to/vendor/twig/twig/lib/Twig/Extension/Core.php
  > on line 1619
  
  This code was previously working on Craft 2, but after the update it is now broken. I've temporarily hard coded the limit in, but that's not ideal.
  
  **Tags:** templating, craft3, error, feed
  
  > **Comments:**
  > **username_1**: What type of field is `feedLimit`?  
  > **username_0**: it's a select and I solved it by changing code to entry.feedLimit.value  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-12-16. Score: 1
  
  Solution is simple, the field type is a select so I need to change
  
  `entry.feedLimit`
  
  to
  
  `entry.feedLimit.value`
  
  And then it works
  
  
  ---
  
  