<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Dashboard]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4435</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4435&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Dashboard.]]></description>
		<lastBuildDate>Fri, 11 Oct 2013 02:46:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Dashboard]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=18084#p18084</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 11 Oct 2013 02:46:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=18084#p18084</guid>
		</item>
		<item>
			<title><![CDATA[Dashboard]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=18010#p18010</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (dvarsani)]]></author>
			<pubDate>Mon, 30 Sep 2013 18:10:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=18010#p18010</guid>
		</item>
	</channel>
</rss>
