<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Dashboard]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4435&amp;type=atom" />
	<updated>2013-10-11T02:46:53Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=4435</id>
		<entry>
			<title type="html"><![CDATA[Re: Dashboard]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18084#p18084" />
			<content type="html"><![CDATA[<p>The field definition for it is:<br /></p><div class="codebox"><pre><code>`collapsed` tinyint(4) NOT NULL</code></pre></div><p>Check your databse if there is any default value such as 0 for the said field. Also see if changing it to NULL or VARCHAR makes any difference.</p><div class="codebox"><pre><code>CREATE TABLE IF NOT EXISTS `0_dashboard_widgets` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `app` varchar(50) NOT NULL,
  `column_id` int(11) NOT NULL,
  `sort_no` int(11) NOT NULL,
  `collapsed` tinyint(4) NOT NULL,
  `widget` varchar(100) NOT NULL,
  `description` varchar(100) NOT NULL,
  `param` text,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;</code></pre></div><p>Wonder why the AUTO_INCREMENT was set to 6 !<br />Wonder why the tinyint(4) should not be tinyint(1) !</p><p>The relevant function that updates it is:<br /></p><div class="codebox"><pre><code>function update_dashboard_widget($selected_id, $app, $user_id, $column_id, $sort_no, $collapsed, $widget, $description, $param)
{
    $sql = &quot;UPDATE &quot;.TB_PREF.&quot;dashboard_widgets SET user_id=&quot; . db_escape($user_id)
        . &quot;,app=&quot; . db_escape($app)
        . &quot;,column_id=&quot; . db_escape($column_id)
        . &quot;,sort_no=&quot; . db_escape($sort_no)
        . &quot;,collapsed=&quot; . db_escape($collapsed)
        . &quot;,widget=&quot; . db_escape($widget)
        . &quot;,description=&quot; . db_escape($description)
        . &quot;,param=&quot; . db_escape($param)
        . &quot; WHERE id = &quot; .db_escape($selected_id);
    db_query($sql,&quot;The widget could not be updated&quot;);
}</code></pre></div><p>The simplest fix may yet be:<br /></p><div class="codebox"><pre><code>function update_dashboard_widget($selected_id, $app, $user_id, $column_id, $sort_no, $collapsed, $widget, $description, $param)
{
    $sql = &quot;UPDATE &quot;.TB_PREF.&quot;dashboard_widgets SET user_id=&quot; . db_escape($user_id)
        . &quot;,app=&quot; . db_escape($app)
        . &quot;,column_id=&quot; . db_escape($column_id)
        . &quot;,sort_no=&quot; . db_escape($sort_no)
        . &quot;,collapsed=&quot; . ((isset($collapsed) &amp;&amp; $collapsed &lt;&gt; 1) ? 0 : 1)
        . &quot;,widget=&quot; . db_escape($widget)
        . &quot;,description=&quot; . db_escape($description)
        . &quot;,param=&quot; . db_escape($param)
        . &quot; WHERE id = &quot; .db_escape($selected_id);
    db_query($sql,&quot;The widget could not be updated&quot;);
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2013-10-11T02:46:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18084#p18084</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Dashboard]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18010#p18010" />
			<content type="html"><![CDATA[<p>I&#039;m getting this error when setting up dashboard</p><p>At file C:\frontaccounting\modules\dashboard\includes\dashboard_db.inc:52:<br />The widget could not be updated<br />error code : 1366<br />error message : Incorrect integer value: &#039;&#039; for column &#039;collapsed&#039; at row 1<br />sql that failed was : UPDATE 0_dashboard_widgets SET user_id=&#039;1&#039;,app=&#039;orders&#039;,column_id=&#039;1&#039;,sort_no=&#039;1&#039;,collapsed=&#039;&#039;,widget=&#039;customers&#039;,description=&#039;test&#039;,param=&#039;{&quot;top&quot;:&quot;10&quot;,&quot;data_filter&quot;:&quot;&quot;,&quot;graph_type&quot;:&quot;ColumnChart&quot;}&#039; WHERE id = &#039;40&#039;</p>]]></content>
			<author>
				<name><![CDATA[dvarsani]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=16332</uri>
			</author>
			<updated>2013-09-30T18:10:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18010#p18010</id>
		</entry>
</feed>
