Welcome to AC Web.
Results 1 to 11 of 11

Thread: PHP Error

  1. #1

    PHP Error


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Ok so I have tried to fix this myself, maybe a PHP guru can help.

    I have done a fresh install to no avail.

    Error
    Code:
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: count(): Parameter must be an array or an object that implements Countable
    
    Filename: libraries/realms.php
    
    Line Number: 329
    Line 329
    Code:
    Line 329: 		if (!count($this->races_en))
    PHP document
    https://pastebin.com/bfSZSmTR


    This is the display i am getting


    Any help is very much appreciated and +rep, thanks!

    - - - Updated - - -

    Ok I fixed it finally

    The fix was a simple as renaming "races_en" to "races"

    // Runtime values
    private $races;
    private $classes;
    private $races_en;
    private $classes_en;
    private $zones;
    private $hordeRaces;
    private $allianceRaces;

    So line 329 should be as follows;

    Code:
    Line 329: 		if (!count($this->races))
    or d4rksider solution
    Code:
    if (!is_array($this->races_en))
    Last edited by do0dles; 03-22-2018 at 11:55 PM. Reason: Solved

  2. #2
    http://armor-creator.cf

    Join Date
    Feb 2014
    Location
    http://armor-creator.cf
    Posts
    1,930
    You may share how you fixed it so if there is anyone got that kind of problem will get it fixed.

  3. #3


    Join Date
    Dec 2010
    Location
    www.TheForgottenCrusade.net
    Posts
    838
    Quote Originally Posted by do0dles View Post
    Ok so I have tried to fix this myself, maybe a PHP guru can help.

    I have done a fresh install to no avail.

    Error
    Code:
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: count(): Parameter must be an array or an object that implements Countable
    
    Filename: libraries/realms.php
    
    Line Number: 329
    Line 329
    Code:
    Line 329: 		if (!count($this->races_en))
    PHP document
    https://pastebin.com/bfSZSmTR


    This is the display i am getting


    Any help is very much appreciated and +rep, thanks!

    - - - Updated - - -

    Ok I fixed it finally
    Can you reach out to me for any working website template out there?

    Discord: Nerc#5355
    Discord server invite: https://discord.gg/MbSQRGV

    You could also PM me on here if that would be more suitable to you.

    Thanks in advance,
    Kind Regards,
    Nerc

  4. #4
    Quote Originally Posted by JadaDev View Post
    You may share how you fixed it so if there is anyone got that kind of problem will get it fixed.
    The fix was a simple as renaming "races_en" to "races"
    // Runtime values
    private $races;
    private $classes;
    private $races_en;
    private $classes_en;
    private $zones;
    private $hordeRaces;
    private $allianceRaces;

    So line 329 should be as follows;
    Code:
    Line 329: 		if (!count($this->races))
    Can you reach out to me for any working website template out there?

    Discord: Nerc#5355
    Discord server invite: https://discord.gg/MbSQRGV

    You could also PM me on here if that would be more suitable to you.

    Thanks in advance,
    Kind Regards,
    Nerc
    I am using FusionCMS which can be downloaded from here: https://emumarket.com/account/download/3
    You can also select from their available themes, and once downloaded just place them in the "themes" folder.

    also note if you are running your website from your local machine or vps and experiencing slow response times make sure you are using "127.0.0.1" instead of "localhost".
    Last edited by do0dles; 03-22-2018 at 07:57 PM.

  5. #5


    Join Date
    Dec 2010
    Location
    www.TheForgottenCrusade.net
    Posts
    838
    Thanks for the info!
    'Repped.

    Kind Regards,
    Nerc

  6. #6
    Quote Originally Posted by Nerc View Post
    Thanks for the info!
    'Repped.

    Kind Regards,
    Nerc
    Awesome, thank you

    Let me know if you have any issues with it as I have set it up already and seen it all probably lol.

  7. #7


    Join Date
    Dec 2010
    Location
    www.TheForgottenCrusade.net
    Posts
    838
    Quote Originally Posted by do0dles View Post
    Awesome, thank you

    Let me know if you have any issues with it as I have set it up already and seen it all probably lol.
    Will do, please hit me up on discord so we can keep contact there .

    Kind Regards,
    Nerc

  8. #8
    http://armor-creator.cf

    Join Date
    Feb 2014
    Location
    http://armor-creator.cf
    Posts
    1,930
    Quote Originally Posted by do0dles View Post
    The fix was a simple as renaming "races_en" to "races"
    // Runtime values
    private $races;
    private $classes;
    private $races_en;
    private $classes_en;
    private $zones;
    private $hordeRaces;
    private $allianceRaces;

    So line 329 should be as follows;
    Code:
    Line 329: 		if (!count($this->races))


    I am using FusionCMS which can be downloaded from here: https://emumarket.com/account/download/3
    You can also select from their available themes, and once downloaded just place them in the "themes" folder.

    also note if you are running your website from your local machine or vps and experiencing slow response times make sure you are using "127.0.0.1" instead of "localhost".
    great share for the fix, add it to your main thread and + rep in advance.

  9. #9
    Quote Originally Posted by do0dles View Post
    The fix was a simple as renaming "races_en" to "races"
    // Runtime values
    private $races;
    private $classes;
    private $races_en;
    private $classes_en;
    private $zones;
    private $hordeRaces;
    private $allianceRaces;

    So line 329 should be as follows;
    Code:
    Line 329: 		if (!count($this->races))
    Obviously this is a cheap fix and i believe doing this will break things if you use other languages than english (try to turn off the ci cache then test). The line #329 should be replaced with something like this:
    Code:
    if (!is_array($this->races_en))

  10. #10
    Quote Originally Posted by JadaDev View Post
    great share for the fix, add it to your main thread and + rep in advance.
    Thank you very much! Added to main post along with d4rksider's. thanks again.


    Quote Originally Posted by d4rksider View Post
    Obviously this is a cheap fix and i believe doing this will break things if you use other languages than english (try to turn off the ci cache then test). The line #329 should be replaced with something like this:
    Code:
    if (!is_array($this->races_en))
    Seems to me it is working as intended lol, if it does break other things outside of showing races I will use your line. Thanks d4rksider.
    Last edited by do0dles; 03-22-2018 at 11:56 PM.

  11. #11

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by do0dles View Post
    Seems to me it is working as intended lol, if it does break other things outside of showing races I will use your line. Thanks d4rksider.
    Well, i just checked the codes with a clean fcms and you're actually right. It wont 'cause any errors even while its a cheap fix and shouldnt be used by repositories. If you check the codes correctly you'll see...

    PHP Code:
        public function formatAvatarPath($character)
        {
            if(!
    count($this->races_en)) // <<<< you change races_en to races here
            
    {
                
    $this->loadConstants();
            }

            
    $classes $this->classes_en;
            
    $races $this->races_en// <<<< while this line still uses races_en 
    So even changing races_en to races will do the trick and races_en gonna get loaded but as i said thats a hack.
    Note; this error only happens when your server is on php +7.x.x or so.
    Last edited by d4rksider; 03-23-2018 at 01:47 AM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •