<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Trying to change Printing Profiles]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4401</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4401&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Trying to change Printing Profiles.]]></description>
		<lastBuildDate>Wed, 18 Sep 2013 16:20:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Trying to change Printing Profiles]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=17876#p17876</link>
			<description><![CDATA[<p>Nice <a href="http://devel.frontaccounting.com/git/?p=fa-stable.git;a=commitdiff;h=38aefa8e6e4edeffecb139d7d7d200b38d41e16e">Fix</a>.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 18 Sep 2013 16:20:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=17876#p17876</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trying to change Printing Profiles]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=17870#p17870</link>
			<description><![CDATA[<p>Fixed in repo, thanks.<br />Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Wed, 18 Sep 2013 13:33:33 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=17870#p17870</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trying to change Printing Profiles]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=17861#p17861</link>
			<description><![CDATA[<p>Lines 1109-1123 of <strong>sql/en_US-new.sql</strong>:<br /></p><div class="codebox"><pre><code>CREATE TABLE IF NOT EXISTS `0_print_profiles` (
  `id` smallint(6) unsigned NOT NULL auto_increment,
  `profile` varchar(30) NOT NULL,
  `report` varchar(5) default NULL,
  `printer` tinyint(3) unsigned default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `profile` (`profile`,`report`)
) ENGINE=MyISAM  AUTO_INCREMENT=10 ;

--
-- Dumping data for table `0_print_profiles`
--

INSERT INTO `0_print_profiles` VALUES(1, &#039;Out of office&#039;, &#039;&#039;, 0);
INSERT INTO `0_print_profiles` VALUES(2, &#039;Sales Department&#039;, &#039;&#039;, 0);</code></pre></div><p>Therefore an integer should be used and not a string. This was not an issue for older MySQL versions, but the later ones after Oracle took over seem to become more strict in such insert syntaxes. Wonder if NULL values would cause trouble (backward compatibility issues) or a mere 0 should suffice.</p><p>Lines 52-65 of <strong>admin/db/printers_db.inc</strong>:<br /></p><div class="codebox"><pre><code>function update_printer_profile($name, $dest)
{
    foreach( $dest as $rep =&gt; $printer) {
        if ($printer != &#039;&#039; || $rep == &#039;&#039;) {
            $sql = &quot;REPLACE INTO &quot;.TB_PREF.&quot;print_profiles &quot;
            .&quot;(profile, report, printer) VALUES (&quot;
            .db_escape($name).&quot;,&quot;
            .db_escape($rep).&quot;,&quot;
            .db_escape($printer).&quot;)&quot;;
        } else {
            $sql = &quot;DELETE FROM &quot;.TB_PREF.&quot;print_profiles WHERE (&quot;
                .&quot;report=&quot; . db_escape($rep)
                .&quot; AND profile=&quot;.db_escape($name).&quot;)&quot;;
        }</code></pre></div><p>A prior integer cast for <strong>$printer</strong> may be in order here.</p><p>The offending line is line 60 in the above code:<br /></p><div class="codebox"><pre><code>            .db_escape($printer).&quot;)&quot;;</code></pre></div><p>which may be replaced with:<br /></p><div class="codebox"><pre><code>            . ($printer + 0) .&quot;)&quot;;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 18 Sep 2013 02:51:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=17861#p17861</guid>
		</item>
		<item>
			<title><![CDATA[Trying to change Printing Profiles]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=17855#p17855</link>
			<description><![CDATA[<p>When I try to make changes to the Sales Department profile, I get this error:</p><p>DATABASE ERROR : could not update printing profile<br />error code : 1366<br />error message : Incorrect integer value: &#039;&#039; for column &#039;printer&#039; at row 1<br />sql that failed was : REPLACE INTO 9_print_profiles (profile, report, printer) VALUES (&#039;Sales Department&#039;,&#039;&#039;,&#039;&#039;)</p>]]></description>
			<author><![CDATA[null@example.com (crspencer@sol-tech.co)]]></author>
			<pubDate>Tue, 17 Sep 2013 21:34:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=17855#p17855</guid>
		</item>
	</channel>
</rss>
