Error messages~

Forum
Last Post
Threads / Messages

Pear

Woah man.
Member
Joined
Dec 14, 2013
Messages
169
Points
16
Age
27
Location
The Underworld
Mysidian Dollar
40,823
Hello! c: It's me again.. Recently my host moved some sites over to a different server (or something like that..) and so my site was one of the ones that moved. However, now I am getting a ton of error messages. I am not experienced in coding at all, so this is all foreign language to me. Does anyone know how I could fix it? c: Thanks for any help<3
This is on the page to use an item:
"Strict Standards: Declaration of DropdownList::add() should be compatible with GUIContainer::add(GUIComponent $component, $index = -1) in /home/capifore/public_html/classes/class_dropdownlist.php on line 184"


And these also show up on the ACP:
"Strict Standards: Declaration of AdminSidebar::setDivision() should be compatible with Sidebar::setDivision(GUIComponent $module) in /home/capifore/public_html/classes/class_adminsidebar.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at /home/capifore/public_html/classes/class_adminsidebar.php:18) in /home/capifore/public_html/classes/class_cookies.php on line 109

Warning: Cannot modify header information - headers already sent by (output started at /home/capifore/public_html/classes/class_adminsidebar.php:18) in /home/capifore/public_html/classes/class_cookies.php on line 111

Warning: Cannot modify header information - headers already sent by (output started at /home/capifore/public_html/classes/class_adminsidebar.php:18) in /home/capifore/public_html/classes/class_view.php on line 257"
 
Well these are just warning messages that do not affect your script, but such messages are annoyingt. To fix that, go to file class_adminsidebar.php and change the method add() to add(GUIComponent $component = NULL, $index = -1).
 
Thank you! But I can't seem to find the exact spot you are talking about. |D
Here's the class_adminsidebar.php if it helps at all. I've tried searching for the method add(), but I'm not sure which one. ^^;
Code:
<?php

use Resource\Collection\ArrayList;

/**
 * The AdminSidebar Class, defines a unique Admin Control Panel Sidebar.
 * It extends from the Sidebar class, although it does not really have much to do with the parent class.
 * @category Resource
 * @package Widget
 * @author Hall of Famer 
 * @copyright Mysidia Adoptables Script
 * @link http://www.mysidiaadoptables.com
 * @since 1.3.3
 * @todo Not much at this point.
 *
 */

class AdminSidebar extends Sidebar implements Initializable{

	/**
     * Constructor of AdminSidebar Class, it initializes basic sidebar properties     
     * @access public
     * @return Void
     */
    public function __construct(){
	    $this->initialize();		
    }
	
	/**
     * The setDivision method, setter method for property $division.
	 * It is set internally upon object instantiation, cannot be accessed in client code.
	 * @param ArrayList $components
     * @access protected
     * @return Void
     */
    protected function setDivision($components){
		$this->division = new Division($components);
		$this->division->setClass("sidebar");
    }

	/**
     * The initialize method, sets up the entire admin sidebar.
     * @access public
     * @return Void
     */		
	public function initialize(){
	    $components = new ArrayList;
		$components->add(new Division(new Link("admincp", "Dashboard")));
		
		$components->add(new Division(new Comment("Adoptable", FALSE)));
		$adoptable = new Division;
		$adoptable->add(new Link("admincp/adopt/add", "Create New Adoptables"));
		$adoptable->add(new Link("admincp/adopt/edit", "Edit Existing Adoptables"));
		$components->add($adoptable);
		
		$components->add(new Division(new Comment("Adopt Levels", FALSE)));
		$level = new Division;
		$level->add(new Link("admincp/level/add", "Add Levels"));
		$level->add(new Link("admincp/level/edit", "Edit Levels"));
		$level->add(new Link("admincp/level/delete", "Delete Levels"));
		$level->add(new Link("admincp/level/settings", "Level Settings"));
		$level->add(new Link("admincp/level/daycare", "Daycare Settings"));		
		$components->add($level);
		
		$components->add(new Division(new Comment("Owned Adoptables", FALSE)));
		$ownedAdoptable = new Division;
		$ownedAdoptable->add(new Link("admincp/ownedadopt/add", "Give Adopt to User"));
		$ownedAdoptable->add(new Link("admincp/ownedadopt/edit", "Manage Users Adopts"));
		$ownedAdoptable->add(new Link("admincp/ownedadopt/delete", "Delete Users Adopts"));
		$components->add($ownedAdoptable);
		
		$components->add(new Division(new Comment("Breeding", FALSE)));
		$breeding = new Division;
		$breeding->add(new Link("admincp/breeding/add", "Create new Breed Adopt"));
		$breeding->add(new Link("admincp/breeding/edit", "Update Existing Breed Adopt"));
		$breeding->add(new Link("admincp/breeding/delete", "Delete Breed Adopt"));
		$breeding->add(new Link("admincp/breeding/settings", "Change Breeding Settings"));
		$components->add($breeding);
		
		$components->add(new Division(new Comment("Images", FALSE)));
		$image = new Division;
		$image->add(new Link("admincp/image/upload", "Upload Images"));
		$image->add(new Link("admincp/image/delete", "Erase Images"));
		$image->add(new Link("admincp/image/settings", "Adoptable Signature Image/GD Settings"));
		$components->add($image);
		
		$components->add(new Division(new Comment("Users", FALSE)));
		$users = new Division;
		$users->add(new Link("admincp/user/edit", "Manage Users"));
		$users->add(new Link("admincp/user/delete", "Delete Users"));
		$components->add($users);
		
		$components->add(new Division(new Comment("Usergroups", FALSE)));
		$usergroups = new Division;
		$usergroups->add(new Link("admincp/usergroup/add", "Add Usergroup"));
		$usergroups->add(new Link("admincp/usergroup/edit", "Edit Usergroup"));
		$usergroups->add(new Link("admincp/usergroup/delete", "Delete Usergroup"));
		$components->add($usergroups);
		
		$components->add(new Division(new Comment("Items", FALSE)));
		$items = new Division;
		$items->add(new Link("admincp/item/add", "Create an Item"));
		$items->add(new Link("admincp/item/edit", "Manage Items"));
		$items->add(new Link("admincp/item/delete", "Delete Items"));
		$items->add(new Link("admincp/item/functions", "Browse Item Functions"));
		$components->add($items);
		
		$components->add(new Division(new Comment("Inventory", FALSE)));
		$inventory = new Division;
		$inventory->add(new Link("admincp/inventory/add", "Give Item to User"));
		$inventory->add(new Link("admincp/inventory/edit", "Edit User Inventory"));
		$inventory->add(new Link("admincp/inventory/delete", "Delete Users items"));
		$components->add($inventory);
		
		$components->add(new Division(new Comment("Shops", FALSE)));
		$shops = new Division;
		$shops->add(new Link("admincp/shop/add", "Add a Shop"));
		$shops->add(new Link("admincp/shop/edit", "Edit Shops"));
		$shops->add(new Link("admincp/shop/delete", "Delete Shops"));
		$components->add($shops);
		
		$components->add(new Division(new Comment("Trade", FALSE)));
		$shops = new Division;
		$shops->add(new Link("admincp/trade/add", "Create a Trade"));
		$shops->add(new Link("admincp/trade/edit", "Update Trades"));
		$shops->add(new Link("admincp/trade/delete", "Remove Trades"));
		$shops->add(new Link("admincp/trade/moderate", "Moderate Trades"));
		$shops->add(new Link("admincp/trade/settings", "Change Trade Settings"));		
		$components->add($shops);		
		
		$components->add(new Division(new Comment("Content", FALSE)));
		$content = new Division;
		$content->add(new Link("admincp/content/add", "Add a Custom Page"));
		$content->add(new Link("admincp/content/edit", "Edit Custom Pages"));
		$content->add(new Link("admincp/content/delete", "Delete Custom Pages"));
		$components->add($content);

		$components->add(new Division(new Comment("Module", FALSE)));
		$module = new Division;
		$module->add(new Link("admincp/module/add", "Create new Module"));
		$module->add(new Link("admincp/module/edit", "Edit Modules"));
		$module->add(new Link("admincp/module/delete", "Delete Modules"));
		$components->add($module);

		$components->add(new Division(new Comment("Widget", FALSE)));
		$widget = new Division;
		$widget->add(new Link("admincp/widget/add", "Create new Widget"));
		$widget->add(new Link("admincp/widget/edit", "Edit Widgets"));
		$widget->add(new Link("admincp/widget/delete", "Delete Widgets"));
		$components->add($widget);
		
		$components->add(new Division(new Comment("Links", FALSE)));
		$links = new Division;
		$links->add(new Link("admincp/links/add", "Add a link"));
		$links->add(new Link("admincp/links/edit", "Edit a link"));
		$links->add(new Link("admincp/links/delete", "Delete a Link"));
		$components->add($links);
		
		$components->add(new Division(new Comment("Promocodes", FALSE)));
		$promo = new Division;
		$promo->add(new Link("admincp/promo/add", "Create New Promocode"));
		$promo->add(new Link("admincp/promo/edit", "Edit Promocodes"));
		$promo->add(new Link("admincp/promo/delete", "Delete Promocodes"));
		$components->add($promo);
	
		$components->add(new Division(new Comment("Themes", FALSE)));
		$theme = new Division;
		$theme->add(new Link("admincp/theme/add", "Add/Install New Theme"));
		$theme->add(new Link("admincp/theme/edit", "Update Themes"));
		$theme->add(new Link("admincp/theme/delete", "Delete Themes"));
		$theme->add(new Link("admincp/theme/css", "Additional CSS"));
		$components->add($theme);
	
		$components->add(new Division(new Comment("Settings", FALSE)));
		$settings = new Division;
		$settings->add(new Link("admincp/settings/globals", "Basic Settings"));
		$settings->add(new Link("admincp/settings/pound", "Pound Settings"));
		$settings->add(new Link("admincp/settings/plugin", "View Plugins"));
		$components->add($settings);
		
		$components->add(new Division(new Comment("Advertising", FALSE)));
		$ads = new Division;
		$ads->add(new Link("admincp/ads/add", "Create New Ad"));
		$ads->add(new Link("admincp/ads/edit", "Edit Current Campaigns"));
		$ads->add(new Link("admincp/ads/delete", "Delete Existing Campaigns"));
		$components->add($ads);
		$this->setDivision($this->addClass($components));
	}

	/**
     * The addClass method, loops through the components array and add classes for each component.
	 * It is set internally upon object instantiation, cannot be accessed in client code.
	 * @param ArrayList  $components
     * @access protected
     * @return ArrayList
     */	
	protected function addClass(ArrayList $components){
	    $components->get(0)->setClass("accordionButton");
		for($i = 1; $i < $components->size(); $i += 2){
		    $components->get($i)->setClass("accordionButton"); 
            $components->get($i + 1)->setClass("accordionContent");			
		}
		return $components;
	}
}
?>
 
Try setDivision() in class_adminsidebar.php to setDivision(GUIComponent $components) and class_DropdownList.php's add() to add(GUIComponent $component, $index = -1)
 
((Sorry for the late reply. I get really busy with school and I had an AP test today. ^^;)

I still am not able to find exactly where you're talking about? I try to find "add()", but it says not found. ^^; <3
 
I was bored since no one has helped me yet, so I decided to research this... stack overflow explains this quite well (although I'm still a little lost since I know very little about php lol)
http://stackoverflow.com/questions/...ards-declaration-of-should-be-compatible-with
http://stackoverflow.com/questions/...laration-of-should-be-compatible-with-that-of


It seems the problem is because this function in class_sidebar:
Code:
	/**
     * The setDivision method, setter method for property $division.
	 * It is set internally upon object instantiation, cannot be accessed in client code.
	 * @param GUIComponent  $module
     * @access protected
     * @return Void
     */
    protected function setDivision(GUIComponent $module){
	    if(!$this->division){
		    $this->division = new Division;
		    $this->division->setClass("sidebar");
		}	
		$this->division->add($module);
    }

Doesn't match this function in class_adminsidebar:
Code:
	/**
     * The setDivision method, setter method for property $division.
	 * It is set internally upon object instantiation, cannot be accessed in client code.
	 * @param ArrayList $components
     * @access protected
     * @return Void
     */
    protected function setDivision($components){
		$this->division = new Division($components);
		$this->division->setClass("sidebar");
    }
Although it looks to me like they both require the same number of parameters, and I don't have any clue if differences in the name of the parameter matter... so I'm not sure what doesn't match...

Either that, or it has something to do with the bug with the order classes are defined and extended. https://bugs.php.net/bug.php?id=46851

The same should apply to the drop down one...

Either way, you might try turning off strict error reporting (something to do with a php.ini file I think) and see if your site works just fine.

My guess is that the php version or setup on the new server is different, and it's possible (I think) that strict error reporting was turned off before otherwise you might have seen the same messages before.

Hopefully Hall Of Famer can shed a little more light on this, since all of my knowledge comes from an hour of googling because this caught my interest. All I can give is information, but I can't tell you what to do with it cause I'm clueless.

I have read at least 50 pages of this section of the forum, and I think previous advice was to turn off strict error reporting, but I can't remember for sure.

Same goes for changing something to suppress the warnings about the headers. That is just telling you that something else on the page already sent headers, so it can't send them again... and previous posts in this forum have suggested they aren't important so just hide them.


HEY, I just noticed something.... could it be because one is a GUIComponent parameter and the other is an ArrayList?
 
Yes, incompatible declarations are when a function's parameters don't match its parent's function parameters for example. Class AdminSidebar extends from Sidebar, so the function's parameters should have the same type, the one in adminsidebar doesn't have a type, that's why I said to put a GUIComponent before the variable name.
PHP doesn't care much about variable types, you don't even need to give them a type, that's why it's just a warning.

And the add function is in class_dropdownlist.php file as public function add($option, $index = -1) ^^
 
Last edited:
(Late reply again..:S)

I still have no clue what you are talking about. |D I understand that the problem is with the class_sidebar and some other things, but I don't understand what you mean, and what I need to replace to fix it. c:<3
 
In class_adminsidebar.php, find this:

PHP:
protected function setDivision($components){
		$this->division = new Division($components);
		$this->division->setClass("sidebar");
    }

Replace with this:
PHP:
protected function setDivision(GUIComponent $components){
		$this->division = new Division($components);
		$this->division->setClass("sidebar");
    }

In class_dropdownlist.php find this:

PHP:
	public function add($option, $index = -1){
	    if(!($option instanceof Option) and !($option instanceof OptGroup)) throw new GUIException("Cannot add a non-option type component to dropdown list.");
	    parent::add($option, $index);			
	}

Replace with this:

PHP:
	public function add(GUIComponent $option, $index = -1){
	    if(!($option instanceof Option) and !($option instanceof OptGroup)) throw new GUIException("Cannot add a non-option type component to dropdown list.");
	    parent::add($option, $index);			
	}
 
Thanks! c: But whenever I change it in the class_adminsidebar it says
"Catchable fatal error: Argument 1 passed to AdminSidebar::setDivision() must be an instance of GUIComponent, instance of Resource\Collection\ArrayList given, called in /home/capifore/public_html/classes/class_adminsidebar.php on line 187 and defined in /home/capifore/public_html/classes/class_adminsidebar.php on line 36"

The other problem seems to be fixed<3 c:
 
Last edited:
Seems like it's passing an arraylist to adminsidebar when it's specified as GUIComponent... Let's try going to class_sidebar.php, setDivision(GUIComponent components) and remove the GUIComponent part. Undo the changes made to class_adminsidebar.php, sorry

If it doesn't work, try this http://stackoverflow.com/a/11429898
 
Thanks. c: Now it says,
"Strict Standards: Declaration of Sidebar::setDivision() should be compatible with Widget::setDivision(GUIComponent $module) in /home/capifore/public_html/classes/class_sidebar.php on line 218"
Maybe I removed the wrong thing? (I copied and pasted a copy before editing so I can completely redo if needed. It was the GUIComponent out of "protected function setDivision(GUIComponent $module)".
c: (It's all good. ^-^)


Also, would you happen to know how to remove the ending / on "http://capiforest.elementfx.com/myadopts/page-2/" on the "my adopts" page in the files to fix it permanently? Because of the / when you click the next page, it stays on the first page and will only go to the next if you manually remove the /. XD

Edit:
I had to completely undo all changes in class_sidebar because it wasn't letting people log in for some reason. Now people can log in. XD
 
Last edited:
Seems like it's passing an arraylist to adminsidebar when it's specified as GUIComponent... Let's try going to class_sidebar.php, setDivision(GUIComponent components) and remove the GUIComponent part. Undo the changes made to class_adminsidebar.php, sorry

If it doesn't work, try this http://stackoverflow.com/a/11429898

Just wanted to say that I was having problems with strict warnings showing everywhere with x10 hosting and the answer from stack overflow solved it completely :DDD

adding

php_value display_errors 0
php_value error_reporting 30719

to .htaccess worked like a charm.

*goes back to lurking*
 
Just wanted to say that I was having problems with strict warnings showing everywhere with x10 hosting and the answer from stack overflow solved it completely :DDD

adding

php_value display_errors 0
php_value error_reporting 30719

to .htaccess worked like a charm.

*goes back to lurking*
That worked!<3 c: Thanks for pointing that out..I forgot to try this..|D
 
Just wanted to say that I was having problems with strict warnings showing everywhere with x10 hosting and the answer from stack overflow solved it completely :DDD

adding

php_value display_errors 0
php_value error_reporting 30719

to .htaccess worked like a charm.

*goes back to lurking*

Just wanted to say... I love you for posting this fix. It solved my issue!
 
Well theres a better way to fix the warning message, I think you can find it in the bug tracker. Lemme know if you cant.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top