Answers.Body: <p>Ok so worked this out whilst working on another plugin. I had to add a variable to the CurateVariable file in order for the template to be able to use the function. Problem solved.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-12T10:43:12.737Z
Answers.LastActivityDate: 2015-08-12T10:43:12.737Z
Answers.UserDisplayName: Lettie
Body: <p>I'm trying to extend a plugin to allow for a limit to be added to the database call but it's throwing an error:</p>
  
  <blockquote>
    <p>Missing argument 1 for Craft\Curate_UsersContentService::getRank(),
    called</p>
  </blockquote>
  
  <p>The services file has a function in it called <code>getRank()</code> and I've added a <code>$count</code> variable to it <code>getRank($count)</code>. My twig template then calls it with the following code:</p>
  
  <pre><code>{% set count = 10 %}
  {% set rank = craft.curate.getRank(count) %}
  </code></pre>
  
  <p>But the above error is thrown. What an I missing?</p>
  
  <p>Any clues appreciated.</p>
  
Tags: <plugin-development><plugins>
Title: Plugin function throwing error for missing argument
ThreadText: # Plugin function throwing error for missing argument
  
  (Asked by: username_0 on 2015-08-12)
  
  I'm trying to extend a plugin to allow for a limit to be added to the database call but it's throwing an error:
  
  > Missing argument 1 for Craft\Curate\_UsersContentService::getRank(),
  > called
  
  The services file has a function in it called `getRank()` and I've added a `$count` variable to it `getRank($count)`. My twig template then calls it with the following code:
  
  ```
  {% set count = 10 %}
  {% set rank = craft.curate.getRank(count) %}
  
  ```
  
  But the above error is thrown. What an I missing?
  
  Any clues appreciated.
  
  **Tags:** plugin-development, plugins
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-08-12. Score: 1
  
  Ok so worked this out whilst working on another plugin. I had to add a variable to the CurateVariable file in order for the template to be able to use the function. Problem solved.
  
  
  ---
  
  