Page 1 of 1

CMSForms

Posted: Sat Dec 18, 2010 12:29 am
by devera
When I install the CMSForm module (need it fot twitter) I get these warnings:

Code: Select all

Warning: Call-time pass-by-reference has been deprecated in /mnt/web1/40/08/51653808/htdocs/GI/CMSMS/modules/CMSForms/lib/classes/CMSForm.class.php on line 149
 
Warning: Call-time pass-by-reference has been deprecated in /mnt/web1/40/08/51653808/htdocs/GI/CMSMS/modules/CMSForms/lib/classes/CMSFormWidget.class.php on line 339
 
Warning: Call-time pass-by-reference has been deprecated in /mnt/web1/40/08/51653808/htdocs/GI/CMSMS/modules/CMSForms/lib/classes/CMSFormWidget.class.php on line 751
 
Warning: Call-time pass-by-reference has been deprecated in /mnt/web1/40/08/51653808/htdocs/GI/CMSMS/modules/CMSForms/lib/classes/CMSFormWidget.class.php on line 757
The code @ the lines is:

Code: Select all

[b]Warning1:[/b]
public function setWidget($name,$type,$settings = array())
	{
		$widget = new CMSFormWidget(&$this,$this->id,$this->module_name,$name,$type,$settings);
		if ($type == 'hidden')
		{
			$this->hidden_widgets[$name] = $widget;
		}
		elseif ($type == 'file')
		{
			$this->setMultipartForm(); // If we add files, we have to be posted multipart forms...
			$this->widgets[$name] = $widget;
		}
		else
		{
			$this->widgets[$name] = $widget;
		}
	}

[b]Warning 2:[/b]
protected function validate()
	{
		if (isset($this->settings['validators']) && is_array($this->settings['validators']))
		{
			//var_dump($this->settings['validators']);
			// CHANGE THAT
			
			foreach ($this->settings['validators'] as $validator => $value)
			{
				$validate = new CMSFormValidator(&$this,$validator,$value);
				try
				{
					if($validate->check() === false) $this->is_valid = false;
				}
				catch(Exception $e)
				{
					$this->setError($e->getMessage(), 'form error');
				}
				
			}
		}
	}
[b]Warning 3 & 4:[/b]
$list = array();
		foreach($items as $key => $item)
		{
			if (is_array($item))
			{
				$list[] = array('label' => '<strong>' . $key . '</strong>', 'input' => '');
	
				foreach($item as $key2 => $entry)
				{
					 self::generateExpandedList(&$list, $id, $entry, $name, $key2, $selecteditems, $multiple, $addttext);
				}
				
			}
			else
			{
				self::generateExpandedList(&$list, $id, $item, $name, $key, $selecteditems, $multiple, $addttext);
			}
		}
Any1 knows how to fix this? Thanks allready

CMS version 1.9.1

Re: CMSForms

Posted: Sat Dec 18, 2010 1:09 am
by Dr.CSS
You may want to try upgrading to CMSMS 1.9.2 first to see if it helps...

Re: CMSForms

Posted: Sat Dec 18, 2010 1:10 am
by calguy1000
Disable E_DEPRECATED messages.

Re: CMSForms

Posted: Sat Dec 18, 2010 9:39 am
by devera
calguy1000 wrote: Disable E_DEPRECATED messages.
And how do i do that?

Re: CMSForms

Posted: Sat Dec 18, 2010 9:51 am
by Coldman
Hi devera

Read this thread about E_DEPRECATED http://forum.cmsmadesimple.org/index.php?topic=43035

Re: CMSForms

Posted: Sat Dec 18, 2010 4:15 pm
by devera
Both solutions didn't work.
When i install the CMSforms module, my showtime also stops working.

Re: CMSForms

Posted: Sun Dec 19, 2010 9:51 pm
by Coldman
Dr.CSS wrote: You may want to try upgrading to CMSMS 1.9.2 first to see if it helps...
Did you upgrade to 1.9.2 as Dr. CSS suggested?

Re: CMSForms

Posted: Wed Dec 22, 2010 4:17 pm
by devera
Yes is did, some errors are gone that I did have before but still the "Call_time Pass_by_reference" warnings are there

Re: CMSForms

Posted: Wed Dec 22, 2010 6:14 pm
by Dr.CSS
Now make sure all extra module are up to date, extensions > Module Manager...

Re: CMSForms

Posted: Tue Feb 08, 2011 8:35 pm
by MTX
I did have the same errors. What I did to get rid of them was the following:
In the CMSForm.class.php and CMSFormValidator.class.php and CMSFormWidget.class.php in the lib directory I searched for the "&$" and replaced that with "$".
That did the trick for me.

Did some investigations on Google and as far as I understood this warning is caused by an old (php 4) style of method call using a reference.

Hope this helps!

Re: CMSForms

Posted: Wed Feb 09, 2011 12:00 am
by Dr.CSS
Need to file a bug report in forge for this module...

Re: CMSForms

Posted: Wed Feb 09, 2011 6:48 pm
by MTX
@Dr.CSS, the bug report is already there, see http://dev.cmsmadesimple.org/bug/view/6031
I don't know how to put this solution to the author.