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

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Jun 27, 2017 at 12:30
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? 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>
answered Jun 27, 2017 at 12:49
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.