0

The error after turning developer mode back on is:

Fatal error: Call to a member function toOptionArray() on a non-object in /home/vimarket/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463

Within the system.xml of the extension, these fields are causing the issue:

<pixenable translate="label">
                      <label>Enable</label>
                      <frontend_type>select</frontend_type>
                      <source_model>adminhtml/system_config_source_yesno</source_model>
                      <sort_order>0</sort_order>
                      <show_in_default>1</show_in_default>
                      <show_in_website>1</show_in_website>
                      <show_in_store>1</show_in_store>
                                                    <comment>Activate this plugin</comment>
                  </pixenable>

                                    <tipe translate="label">
                      <label>Tracking Type</label>
                      <frontend_type>select</frontend_type>
                      <source_model>adminhtml/system_config_source_tracktype</source_model>
                      <sort_order>1</sort_order>
                      <show_in_default>1</show_in_default>
                      <show_in_website>1</show_in_website>
                      <show_in_store>1</show_in_store>
                    </tipe>

They're within the tags. So, the paths of these must not be there, but I can't figure out exactly where the paths should be.

Config.xml:

<?xml version="1.0"?>
<config>
 <modules>
    <PixelMarket_Pixel>
        <version>1.0.0</version>
    </PixelMarket_Pixel>
</modules>
<frontend>
    <routers>
        <pixel>
        <use>standard</use>
            <args>
              <module>PixelMarket_Pixel</module>
              <frontName>pixel</frontName>
            </args>
        </pixel>
    </routers>
        <layout>
            <updates>
                   <pixel>
                        <file>pixel.xml</file>
                   </pixel>
            </updates>
        </layout>
</frontend>
<global>
    <helpers>
        <pixel>
          <class>PixelMarket_Pixel_Helper</class>
        </pixel>
    </helpers>
      <blocks>
         <pixel>
               <class>PixelMarket_Pixel_Block</class>
         </pixel>
      </blocks>
      <models>
         <pixel>
               <class>PixelMarket_Pixel_Model</class>
                 <resourceModel>pixel_mysql4</resourceModel>
         </pixel>
         <pixel_mysql4>
               <class>PixelMarket_Pixel_Model_Mysql4</class>
                 <entities>
                        <reftable>
                                <table>reftable</table>
                        </reftable>
             </entities>
         </pixel_mysql4>
      </models>
      <resources>
         <pixel_setup>
               <setup>
                   <module>PixelMarket_Pixel</module>
               </setup>
               <connection>
                   <use>core_setup</use>
               </connection>
         </pixel_setup>
        <pixel_write>
              <connection>
                  <use>core_write</use>
              </connection>
        </pixel_write>
        <pixel_read>
              <connection>
                  <use>core_read</use>
              </connection>
        </pixel_read>
      </resources>
  </global>
  <admin>
       <routers>
          <pixel>
             <use>admin</use>
               <args>
                   <module>PixelMarket_Pixel</module>
                  <frontName>pixel</frontName>
               </args>
          </pixel>
       </routers>
  </admin>
  <adminhtml>
       <menu>
          <pixel module="pixel">
                <title>Pixel</title>
                <sort_order>100</sort_order>
                <children>
                    <reftable module="pixel">
                        <title>Manage Reftable</title>
                          <sort_order>0</sort_order>
                          <action>pixel/adminhtml_reftable</action>
                    </reftable>
                </children>
          </pixel>
      </menu>
       <acl>
          <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                           <pixel translate="title" module="pixel">
                                <title>Track Customer</title>
                                <sort_order>1000</sort_order>
                                   <children>
                                     <reftable translate="title">
                                            <title>Manage Tracker</title>
                                            <sort_order>0</sort_order>
                                     </reftable>
                                   </children>
                          </pixel>
                    </children>
                </admin>
          </resources>
        </acl>
        <layout>
           <updates>
                 <pixel>
                     <file>pixel.xml</file>
                 </pixel>
          </updates>
        </layout>
    </adminhtml>
</config>
6
  • 1
    Have you been to the admin page for this extension and actually saved the options?
    – BlueC
    Jun 12, 2016 at 20:12
  • I can't get to the admin page for it at all. There's a tab at the top to manage a table of information (it's a customer tracking extension), and then there're additional options on the left side panel in System Configuration where you enable it and such. That's the one that I can't get to. If I take the system.xml off the server, I can access the admin panel's main System Config page. If I put it back on the server, sometimes I can (only on Chrome, never on Firefox). But I have yet been able to access the actual options for the extension without getting the HTTP Error 500 page.
    – taskle
    Jun 12, 2016 at 21:06
  • if it's a paid extension ask their support. reinstall the extension and if it is working then your edits are incorrect, if not, then the extension is rubbish and you should ask for support or money back. otherwise, your question is off-topic here Jun 12, 2016 at 21:48
  • 1
    Check your logs to find out what is causing the 500 error. A common problem is that the helper for this module is missing.
    – scrowler
    Jun 12, 2016 at 22:56
  • 1
    After turning developer mode back on via index.php, this is the error I'm getting: Fatal error: Call to a member function toOptionArray() on a non-object in /home/vimarket/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463 Edited original question
    – taskle
    Jun 12, 2016 at 23:26

2 Answers 2

3

The problem comes from:

 <source_model>adminhtml/system_config_source_tracktype</source_model>

This source model does not exist. There is also no other source model in the core, called "tracktype", so it's unclear to me what they are trying to do here. A custom source model should not be added to the Mage_Adminhtml namespace but to the extension namespace.

Conclusion: It's a bug in the extension, their system.xml is wrong.

6
  • So if I placed tracktype.php in Pixel/Model/Adminhtml/System/Config/Source, and changed the source model to pixel/system_config_source_tracktype, would this work?
    – taskle
    Jun 13, 2016 at 18:39
  • @taskle Yes, exactly, though I find this module to be quite dubious in terms of quality. Can you share a link?
    – benmarks
    Jun 13, 2016 at 19:04
  • Would the class within the tracktype.php be changed from class Mage_Adminhtml_Model_System_Config_Source_Tracktype to class Pixel_Model_Adminhtml_System_Config_Source_Tracktype ? @benmarks codecanyon.net/item/magento-customer-tracker/5656303 was purchased
    – taskle
    Jun 13, 2016 at 19:11
  • "Would the class within the tracktype.php be changed... to Pixel_..." That's the ticket, mate ;-)
    – benmarks
    Jun 13, 2016 at 21:01
  • So, I'm receiving this error: Warning: include(PixelMarket/Pixel/Model/System/Config/Source/Tracktype.php): failed to open stream: No such file or directory in /home/.../public_html/lib/Varien/Autoload.php on line 93 I would assume I need to add something further to my config.xml as well? Do I need to define the model? (My current config.xml is posted above)
    – taskle
    Jun 13, 2016 at 22:51
-1

You need to create Tracktype.php file into this file path Block/Adminhtml/System/Config/Tracktype.php

Add below code into system.xml file

                  <tipe translate="label">
                  <label>Tracking Type</label>
                  <frontend_type>select</frontend_type>
                  <frontend_model>YOURMODULENAME/adminhtml_system_config_source_tracktype</frontend_model>
                  <sort_order>1</sort_order>
                  <show_in_default>1</show_in_default>
                  <show_in_website>1</show_in_website>
                  <show_in_store>1</show_in_store>
                </tipe>
2
  • 1
    Creating a file within the core to mask the problem? That's a bad idea. Also how would you know what to put inside? Jun 13, 2016 at 6:41
  • The file is currently in the core (how it was in the original extension), so I assume @Magikvishal means within the custom module's Block directory? Then using <frontend_model>? I think
    – taskle
    Jun 13, 2016 at 18:53

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.