0

app\code\local\Jurgis\Twilio\etc\system.xml

<language translate="label">
          <label>Voice Language</label>
          <frontend_type>select</frontend_type>
          <source_model>Twilio/Language</source_model>
          <sort_order>92</sort_order>
          <show_in_default>1</show_in_default>
          <show_in_website>1</show_in_website>
          <show_in_store>1</show_in_store>
</language>

app\code\local\Jurgis\Twilio\etc\config.xml

<?xml version="1.0"?>

<config>
    <modules>
        <Jurgis_Twilio>
            <version>1.0.0</version>
        </Jurgis_Twilio>
    </modules>
    <global>
      <helpers>
          <Jurgis_Twilio>
            <class>Jurgis_Twilio_Helper</class>
        </Jurgis_Twilio>
      </helpers>
      <models>
        <Jurgis_Twilio>
                  <class>Jurgis_Twilio_Model</class>
        </Jurgis_Twilio>
      </models>
    </global>

app\code\local\Jurgis\Twilio\Model\Language.php

<?php
class Jurgis_Twilio_Model_Language
{
    public function toOptionArray()
    {
      return array(
            array(
                'value' => 'key1',
                'label' => 'Value 1',
            ),
            array(
                'value' => 'key2',
                'label' => 'Value 2',
            ),
        );
    }
}

When I go to my admin config, I get the error:

Fatal error: Call to a member function toOptionArray() on boolean in ...\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php on line 463

2
  • Looks like it can't find you source model, which points to incorrect config.xml configuration me thinks. Also maybe cache. Can you add your config.xml?
    – pip
    Commented Jun 27, 2017 at 12:41
  • Added config.xml Commented Jun 27, 2017 at 12:47

1 Answer 1

2

change this

 <source_model>Twilio/Language</source_model>

to this

 <source_model>Jurgis_Twilio/Language</source_model>
1
  • Ahh, thank you... Couldn't spot it myself Commented Jun 27, 2017 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.