We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Ignore that PHP Notice for now; it is harmless. The process should create the folders so long as the user running the PHP process has permission to write to that directory.
      • 17838
      • 82 Posts
      Quote from: OpenGeek at Oct 01, 2009, 02:55 PM

      ... so long as the user running the PHP process has permission to write to that directory.
      Sure, it has. For sure I made test.php with mkdir.

      But I don’t see any new dircetories created neither new database table.

      The message out of a browser window says:
      2009-10-01 21:56:59] (INFO @ /core/components/klimatyzacja/trunk/_build/build.schema.php)
      
      Skipping /home/refleksolog/ftp/modx/core/components/klimatyzacja/trunk/core/components/klimatyzacja/model/klimatyzacja//klimafirmy.class.php; file already exists.
      Move existing class files to regenerate them.
      [2009-10-01 21:56:59] (INFO @ /core/components/klimatyzacja/trunk/_build/build.schema.php)
      
      Skipping /home/refleksolog/ftp/modx/core/components/klimatyzacja/trunk/core/components/klimatyzacja/model/klimatyzacja/mysql/klimafirmy.class.php; file already exists.
      Move existing class files to regenerate them.
      Execution time: 1.6012 s
      [2009-10-01 21:56:59] (WARN @ /home/refleksolog/ftp/modx/core/xpdo/om/xpdoobject.class.php : 932)
      
      PHP notice: A non well formed numeric value encountered


      But I can’t find any /home/refleksolog/ftp/modx/core/components/klimatyzacja/trunk/core/components/klimatyzacja/model/klimatyzacja/mysql/klimafirmy.class.php file

      --
      Regards
      MM
        • 22303 MODX Staff
        • 10,725 Posts
        This just creates the classes not the tables. And it says they already exist, thus it’s skipping them. huh
          • 17838
          • 82 Posts
          Ok, great.

          While I was writing previous post I could find any class files. I’ve opened my FTP client again and there they are!
          Strange, but for now everything is ok.

          Thank you for your patience,

          Regards
          MM
            • 22303 MODX Staff
            • 10,725 Posts
            FTP clients generally cache file listings unless you force refresh changes like this. In general, I always generate classes (and do most of my development) on a local machine to avoid these kinds of issues. It really is a good habit to get into, and you avoid problems working with remote systems.
              • 17838
              • 82 Posts
              Now I get following error:

              Fatal error: Call to a member function HÍö9DŞc`Ťx�CÍ��2Lľ˘?`ŤxřţĚźł˘?() on a non-object in /home/refleksolog/ftp/modx2/core/components/klimatyzacja/trunk/core/components/klimatyzacja/snippet.klimatyzacja.php on line 10


              My snippet:
              <?php
              /**
               * @package klimatyzacja
               */
              $base_path = !empty($base_path) ? $base_path : $modx->getOption('core_path').'components/klimatyzacja/trunk/core/components/klimatyzacja/';
              
              $modx->addPackage('klimatyzacja',$base_path.'model/klimatyzacja/');
              
              echo $base_path.'model/klimatyzacja/'; //outputs: /home/refleksolog/ftp/modx2/core/components/klimatyzacja/trunk/core/components/klimatyzacja/model/klimatyzacja/
              
              $firmy = $modx->newObject('klimaFirmy');
              $firmy->fromArray(array(
                  'nazwa' => 'Miś',
                  'dzialalnosc' => 'England',
                  'dzialalnosc_en' => 'jakaś dzialalnosc',
                  'www' => 'asdads;lkj',
                  'email' => ';lajdf',
                  'tel' => '14125254',
                  'fax' => '555-2134-543',
                  'adres' => '12 Grimmauld Place',
                  'miasto' => 'London',    
                  'kod' => '12345',
                  'wpis' => 'asdfl;jk a;ldfjk',
                  'logo' => 'ads las',
                  'logo_a' => '1',
                  'rozsz' => '1asd',
                  'o_kont' => 'asdf;l',
                  't_kont' => 'as;ldk',
                  'em_kont' => 'asldfjk',
                  'nazwa2' => 'asfd;lj',
                  'adres2' => 'alskjdf',
                  'kod2' => 'asdlfj',
                  'miasto2' => 'asdlj',
                  'nip' => '7878228282',
                  'kolejnosc' => '2',
                  'aktywacja' => '1',
                  'data' => '1000-01-01',
                  'koniec' => '1000-01-01',
                  'polecamy' => '1'
                  
              ));
              $firmy->save();
              
              $firmy = $modx->getCollection('klimaFirmy');
              echo 'Total: '.count($firmy);
              
              ?>


              The schema is
              <?xml version="1.0" encoding="UTF-8"?>
              <model package="klimatyzacja" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM">
              <object class="klimaFirmy" table="klima_firmy" extends="xPDOSimpleObject">
              <field key="nazwa" dbtype="varchar" precision="250" phptype="string" null="false" default="" index="index" />
              <field key="dzialalnosc" dbtype="text" phptype="string" null="false" default="" />
              <field key="dzialalnosc_en" dbtype="text" phptype="string" null="false" default="" />
              <field key="www" dbtype="varchar" precision="250" phptype="string" null="false" default="" />
              <field key="email" dbtype="varchar" precision="250" phptype="string" null="false" default="" />
              <field key="tel" dbtype="varchar" precision="30" phptype="string" null="false" default="" />
              <field key="fax" dbtype="varchar" precision="30" phptype="string" null="false" default="" />
              <field key="adres" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
              <field key="miasto" dbtype="varchar" precision="30" phptype="string" null="false" default="" />
              <field key="kod" dbtype="varchar" precision="10" phptype="string" null="false" default="" />
              <field key="wpis" dbtype="enum" precision="'2','1','0'" phptype="string" null="false" default="0" />
              <field key="logo" dbtype="varchar" precision="250" phptype="string" null="false" default="" />
              <field key="logo_a" dbtype="enum" precision="'0','1'" phptype="string" null="false" default="0" />
              <field key="rozsz" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
              <field key="o_kont" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
              <field key="t_kont" dbtype="varchar" precision="50" phptype="string" null="false" default="" />
              <field key="em_kont" dbtype="varchar" precision="50" phptype="string" null="false" default="" />
              <field key="nazwa2" dbtype="varchar" precision="250" phptype="string" null="false" default="" index="index" />
              <field key="adres2" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
              <field key="kod2" dbtype="varchar" precision="10" phptype="string" null="false" default="" />
              <field key="miasto2" dbtype="varchar" precision="30" phptype="string" null="false" default="" />
              <field key="nip" dbtype="varchar" precision="30" phptype="string" null="false" default="" />
              <field key="kolejnosc" dbtype="int" precision="11" phptype="integer" attributes="unsigned" null="false" default="0" />
              <field key="aktywacja" dbtype="enum" precision="'0','1'" phptype="string" null="false" default="0" />
              <field key="data" dbtype="date" precision="11" phptype="integer" attributes="unsigned" null="false" default="" />
              <field key="koniec" dbtype="date" precision="11" phptype="string" attributes="unsigned" null="false" default="" />
              <field key="polecamy" dbtype="enum" precision="'0','1'" phptype="string" null="false" default="0"/>
              </object>
              </model>


              Folder structure:


              So it’s not working for me. I have no idea what could be the reason. As it was said: table should be created dynamically, but no table has been created.

              --
              Regards
              MM

                • 22303 MODX Staff
                • 10,725 Posts
                What the heck is HÍö9DŞc`Ťx�CÍ��2Lľ˘?`ŤxřţĚźł˘?() ?
                  • 17838
                  • 82 Posts
                  Quote from: OpenGeek at Oct 03, 2009, 07:00 PM

                  What the heck is HÍö9DŞc`Ťx�CÍ��2Lľ˘?`ŤxřţĚźł˘?() ?

                  I wish I knew. It’s what my server said to my browser.
                  Vide: http://panel2.webmachinist.pl/?id=1

                  I’ve removed echoing path now and line which it poits is:
                  $firmy->fromArray(array(
                  ’nazwa’ => ’Miś’, \n

                  --
                  Regards
                  MM
                    • 17838
                    • 82 Posts
                    Ok, I found a mistake (I think) in tutorial:

                    http://modxcms.com/about/blog/shaun-mccormick/storefinder.html

                    It’s where you add package:
                    $modx->addPackage('storefinder',$base_path.'model/storefinder/');


                    I found somewhere on the MODx site it should look like:
                    $modx->addPackage('storefinder',$base_path.'model/');


                    So I’ve changed it. Script didn’t create new table but after I had created it by myself it started adding new records to that table.
                    I don’t know if it’s good it didnt do it automatically.

                    --
                    Regards
                    MM
                      • 28215
                      • 4,149 Posts
                      It was fixed in Confluence; changed that blog post to just refer to the Confluence article.
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com