Jump to content

Parse error for my custom module


Truemedia
 Share

Recommended Posts

I'm nearly ready to sell a module I made for prestashop which I have tested to make sure everything is working on a local server and as far as I know and have seen and tested everything is working fine.

But when uploaded the module to a live site, when I click on the back office modules tab I get "Parse error(s) in module(s)" and beneath it the name of my module. I didn't get this on localhost and I'm not sure how to debug to find what's wrong on this server. Not many posts on this subject so can anyone tell me how I can somehow find out whats going wrong, debug this module.

Once I can find out what's wrong I can fix it, but just don't know how to find out from an error message that doesn't give me any solid debugging details. Any help is appreciated thanks.

Share this post


Link to post
Share on other sites

Same version on both servers, and php debugging is on on both so not much difference between the 2.

EDIT: Although I have had a few wierd instances in the past of something working in localhost and failing on my server, another instance would be although I am running prestashop v.1.3.1.1 I don't get an update prompt on the back office yet I do in localhost :-S, very odd.

Share this post


Link to post
Share on other sites

My host has very odd restrictions and this seems to be no problem from the module itself, so I will continue on with posting the module for sale and if this seems to popup with any customers who bought this module I will immediately offer support and help them around the restriction.

If this happens to anyone who purchases the module (which shouldn't unless they have the same host), please don't panic and just ask for my help. I should have a fix for my host soon anyway by working around the restriction.

Share this post


Link to post
Share on other sites

This seems to be the function freaking out my host but works fine everywhere else:

public function getLinks()
   {
        $result = array();
        /* Get id and url */
        if (!$links = Db::getInstance()->ExecuteS('SELECT `id_link`, `url`, `new_window` FROM '._DB_PREFIX_.'gum'.(intval(Configuration::get('PS_GUM_ORDERWAY')) == 1 ? ' ORDER BY `id_link` DESC' : '')))
            return false;
        $i = 0;
        foreach ($links AS $link)
        {
            $result[$i]['id'] = $link['id_link'];
           $result[$i]['url'] = $link['url'];
           $result[$i]['newWindow'] = $link['new_window'];
           /* set custom css width and length */
           $testing_oh = $this::setWidths(715,count($links));
           if($i == 0){
               $result[$i]['link_length'] = $testing_oh['first_link'] . "px";
           }
           elseif($i == count($links) - 1){
               $result[$i]['link_length'] = $testing_oh['last_link'] -1 . "px"; // compensate for border of 1px;
           }
           else{
               $result[$i]['link_length'] = $testing_oh['middle_link'] . "px";
           }
           /* Get multilingual text */
           if (!$texts = Db::getInstance()->ExecuteS('SELECT `id_lang`, `text` FROM '._DB_PREFIX_.'gum_lang WHERE `id_link`='.intval($link['id_link'])))
               return false;
           foreach ($texts AS $text)
               $result[$i]['text_'.$text['id_lang']] = $text['text'];
           $i++;
       }
        return $result;
   }



Going to look into it but looks like it will be useful for future reference.

Share this post


Link to post
Share on other sites

Solved the problem with my own server by been more direct with the class call but there is no logo and I get

1 error
module not found

when installing.

Now the icon is called logo has an image extension of .gif and is 16 by 16 pixels just like all other icons in all other modules and there is no reasonable explanation for this, or the module not found.

Looking into it once again but not many topics cover these errors and nothing is mentioned in an official documentation, so it is a very painful process of testing chunks of code.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More