Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Notice "Undefined variable: js"

Notice "Undefined variable: js" 28 Sep 2013 22:53 #11223

  • yves
  • yves's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
My component works fine in the Sandbox 3.0.

After download on a local Joomla 3.1.5 platform, I get this message from JDomHtmlGridTaskTask->buildJs( ) :
"Notice: Undefined variable: js in C:\wamp\www\joomla\administrator\components\com_test\dom\html\grid\task\task.php on line 106"

I downloaded the component with Embed Framework = Yes, same trouble.

Does somebody has any Idea ?
Thanks
The administrator has disabled public write access.

Notice "Undefined variable: js" 28 Sep 2013 23:12 #11225

  • Tomaselli
  • Tomaselli's Avatar
  • Offline
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
that's just a notice, I usually don't care about notices and warnings. I know I should but I have no time for the "state of the art" coding.

by the way, this fix it, go to that file and add the line /* hack */:
	function buildJs()
	{
		$js = false; /* hack */
The administrator has disabled public write access.
The following user(s) said Thank You: yves

Notice "Undefined variable: js" 29 Sep 2013 14:07 #11234

  • yves
  • yves's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
Thanks for showing me the way.

I understand this is due to a different error_reporting setting in the sandbox and my local environment.

Anyway, I fixed the buildJs() function using isset() so that php is happy and notice disappeared, :
if (isset($js))
	$this->addScriptInline($js, false, null);
instead of :
if ($js)
	$this->addScriptInline($js, false, null);
Last Edit: 29 Sep 2013 14:37 by yves.
The administrator has disabled public write access.

Notice "Undefined variable: js" 29 Sep 2013 14:35 #11235

  • yves
  • yves's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
Also had to fix another notice of missing property on dom\html\form\input\select\radio.php (to show publication icons) in buildRadio.
I commented 3 lines, but I"m not sure this is the right fix :
//if (!$viewType = $this->viewType)
//{
	if (isset($item->$viewKey))
		$viewType = $item->$viewKey;
	else
		$viewType = 'both';	
//}
The administrator has disabled public write access.

Notice "Undefined variable: js" 29 Sep 2013 23:42 #11244

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Both fixed.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: yves
Time to create page: 0.085 seconds

Get Started