<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi,<br>
    <br>
    this error comes up on saving a copy.<br>
    But only on custom modules based on the vtlib example.<br>
    <br>
    small backtrace:<br>
    [0]=&gt;<br>
        ["file"]=&gt;      string(54) "data\CRMEntity.php"<br>
        ["line"]=&gt;      int(104)<br>
        ["function"]=&gt;  string(19) "save_related_module"<br>
        ["class"]=&gt;     string(9) "CRMEntity"<br>
    [1]=&gt;<br>
        ["file"]=&gt;      string(54) "data\CRMEntity.php"<br>
        ["line"]=&gt;      int(860)<br>
        ["function"]=&gt;  string(10) "saveentity"<br>
        ["class"]=&gt;     string(9) "CRMEntity"<br>
        ["type"]=&gt;      string(2) "-&gt;"<br>
        ["args"]=&gt;      [0]=&gt; "CPEmployee" [1]=&gt;""<br>
    [2]=&gt;<br>
        ["file"]=&gt;      string(63) "modules\CPEmployee\Save.php"<br>
        ["line"]=&gt;      int(29)<br>
        ["function"]=&gt;  string(4) "save"<br>
        ["class"]=&gt;     string(9) "CRMEntity"<br>
        ["type"]=&gt;      string(2) "-&gt;"<br>
        ["args"]=&gt;      [0]=&gt; "CPEmployee"<br>
    [3]=&gt;<br>
        ["file"]=&gt;      string(45) "index.php"<br>
        ["line"]=&gt;      int(711)<br>
        ["args"]=&gt;      [0]=&gt;"modules\CPEmployee\Save.php"<br>
    <br>
    <br>
    CRMEntity.php line 94: $for_crmid  =
    vtlib_purify($_REQUEST['return_id']);<br>
    return_id is empty and the error occurs.<br>
    But i dont know the return id because its a copy.<br>
    Working with globals like $_REQUEST in methods is a bad idea.<br>
    <br>
    A better place to make the patch is maybe in line 100.<br>
    <br>
    if($on_focus-&gt;IsCustomModule &amp;&amp; method_exists($on_focus,
    'save_related_module')) {<br>
    to<br>
    if($on_focus-&gt;IsCustomModule &amp;&amp; method_exists($on_focus,
    'save_related_module') &amp;&amp; !empty($for_crmid)) {<br>
    <br>
    <br>
    Maybe it is the "method_exists($on_focus, 'save_related_module')" in
    line 100.<br>
    My Class has no save_related_module but the CRMEntity has.<br>
    With an empty method save_related_module all is fine.<br>
    But its only a workaround.<br>
    <br>
    <br>
    Am 04.02.2011 10:59, schrieb maltesh:
    <blockquote
      cite="mid:AANLkTi=GdBybP4bbRNWPAcODLJx98W_h71FnXa2iab0x@mail.gmail.com"
      type="cite">Robert<br>
      <br>
      Can you please tell  for which operation the SQL error message
      comes up.<br>
      <br>
      <div class="gmail_quote">On Wed, Jan 12, 2011 at 5:14 PM, Robert
        Willert <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:robert.willert@conceptpeople.de">robert.willert@conceptpeople.de</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">Now with correct subject.<br>
          <br>
          This patch will fix an SQL error message on save an CRMEntity
          copy.<br>
          <br>
          Best regards<br>
          Robert Willert<br>
          <br>
          -- <br>
          <br>
          ConceptPeople consulting gmbh<br>
          <br>
          Robert Willert<br>
          System Administrator<br>
          <br>
          ConceptPeople consulting gmbh<br>
          Kurze Mühren 20<br>
          20095 Hamburg<br>
          <br>
          Tel: 040 - 600 90 75-72<br>
          Fax: 040 - 600 90 75-71<br>
          <a moz-do-not-send="true" href="http://www.conceptpeople.de"
            target="_blank">www.conceptpeople.de</a><br>
          <br>
          Geschäftsführer:<br>
          Bjarne Jansen, Philipp Meißner, Andreas Rother<br>
          Steuer-Nr: 74/858/00985<br>
          UID-NR: DE219814648<br>
          Registergericht:<br>
          Hamburg, HRB 82938<br>
          <br>
          <br>
          <br>
          <br>
          <br>
          _______________________________________________<br>
          <a moz-do-not-send="true" href="http://www.vtiger.com/"
            target="_blank">http://www.vtiger.com/</a><br>
        </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      Maltesh<br>
      Vtiger Team<br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
    </blockquote>
    <br>
  </body>
</html>