We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17499 ☆ A M B ☆
    • 872 Posts
    Hello,

    Do anyone know how to set the document template with FDM?
    Newpublisher and NewsEditor had the option &template which don’t exist with FDM.
      • 13428 ☆ A M B ☆
      • 1,031 Posts
      Quote from: mcclausky at Sep 08, 2008, 03:35 PM

      2) Duplicaded rows on table site_tmplvar_contentvalues: Well, this one is not really a problem I guess, but I noticed that every time a new document is created, the data inserted on table site_tmplvar_contentvalues is being duplicated (double inserted). Something like this:
      [table]
      [tr]
      [td]id[/td]
      [td]tmplvarid[/td]
      [td]contentid[/td]
      [td]value[/td]
      [/tr]
      [tr]
      [td]752[/td]
      [td] 18[/td]
      [td]170[/td]
      [td]hi there[/td]
      [/tr]
      [tr]
      [td]753[/td]
      [td] 19[/td]
      [td]170[/td]
      [td]hello[/td]
      [/tr]
      [tr]
      [td]754[/td]
      [td] 18[/td]
      [td]170[/td]
      [td]hi there[/td]
      [/tr]
      [tr]
      [td]755[/td]
      [td] 19[/td]
      [td]170[/td]
      [td]hello[/td]
      [/tr]
      [/table]

      At first, this duplication looks like an error. I don’t know if it’s afffecting the behavior of the documents, because so far I didn’t notice any problem. What do you think?

      Noticed this too. It did not cause any problems by now but site_tmplvar_contentvalues will grow twice if the bug won’t be fixed. Maybe it occours because the TVs aren’t set in the model – no, they are duplicated either.

      I don’t see any bug in fdm.class.inc.php. Maybe it is in fdm.db.class.inc.php
        • 13428 ☆ A M B ☆
        • 1,031 Posts
        Found the Bug. It happens only if &aliastype is not set (or set to %id%). At this time the document will be saved twice and the second save causes the problem (lines 337-343 in fdm.class.inc.php).

        The bug is located in fdm.db.class.inc.php in function SaveTVs. In the first lines of the function the array $this->oldTVs will be filled only if it is not an array and if the flag $this->isNew is not set (BTW: $this->isNew will never be true here if SaveTVs is called by Save because of another bug - the reset of $this->isNew has to be at the end of Save). After the first save the array $this->oldTVs is not filled but it is an array - so with every SaveTV after the TVs will be inserted in the DB not updated. As a solution $this->oldTVs could be filled by $this->fillOldTVValues() but the following solution will not use any DB connection.

        Insert after:
        349: $sql="INSERT INTO $tvc (tmplvarid,value,contentid) VALUES ($tmplvarid,'$escapedValue',$id)";

        following code:
        350: $this->oldTVs[$tv] = $this->tvNames[$tv];


        and move this line to the end (line 320) of function save:
        314: $this->isNew = false;


        @Soda: Could you fix this bug in the first post?
          • 19688
          • 21 Posts
          I am so very happy this bug was resolved.

          Quote from: mishoo78 at Oct 08, 2008, 01:36 AM

          this behaviour is quite annoing, because if I edit one of these tv-s in the manager, only one of these database entries are updated, and I get meself an document with 2 instances of the same tv but with 2 different values
            • 27205
            • 6 Posts
            Hi, I’m also experiencing the same error as stargatesg1, when installing FDM. I get this error when I enter the ’FDM’ module in the ’Modules’:

            Warning: include_once(/Volumes/Data02/BKS_tbm/assets/snippets/FDM/includes/install.class.inc.php) [function.include-once]: failed to open stream: No such file or directory in /Volumes/Data02/bks_tbm_web/manager/processors/execute_module.processor.php(114) : eval()'d code on line 1
            
            Warning: include_once() [function.include]: Failed opening '/Volumes/Data02/BKS_tbm/assets/snippets/FDM/includes/install.class.inc.php' for inclusion (include_path='/Volumes/Data02/bks_tbm_web/manager/includes/') in /Volumes/Data02/bks_tbm_web/manager/processors/execute_module.processor.php(114) : eval()'d code on line 1
            Installation de FDM.
            
            Fatal error: Class 'installation' not found in /Volumes/Data02/bks_tbm_web/manager/processors/execute_module.processor.php(114) : eval()'d code on line 7


            Did I miss something?
            Any help appreciated grin
              • 36592
              • 970 Posts
              FDM is a snippet, not a module...
                • 10792
                • 13 Posts
                Hi all, i have a quick issue.

                Note 1: Thank Soda, you snippets work well for me.
                Note 2: i have read all the 36 pages of this thread, i have found no answer, so i post my question.

                Question: It is possibile for anonymous users add published documents?

                I have tried to modify the snippets without success sad

                Any help would be appreciated,
                thanks Gianfra
                  • 17499 ☆ A M B ☆
                  • 872 Posts
                  Quote from: lossendae at Feb 09, 2009, 06:17 PM

                  Hello,

                  Do anyone know how to set the document template with FDM?
                  Newpublisher and NewsEditor had the option &template which don’t exist with FDM.


                  Nobody can help me? either in the french nor the international forum?

                  How sad...
                    • 13428 ☆ A M B ☆
                    • 1,031 Posts
                    You can use &model=`xx`. The document referenced in this id is used as model for the new document. The template and every other filled field will be used for the new document.
                      • 17499 ☆ A M B ☆
                      • 872 Posts
                      Quote from: Jako at Feb 24, 2009, 08:15 AM

                      You can use &model=`xx`. The document referenced in this id is used as model for the new document. The template and every other filled field will be used for the new document.

                      I’ve seen this option but i think that choose the template itself is more accurate for my need!
                      FDM is more handy thant the other free other way available but lack this precious feature.

                      Thanks for your help.