We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13735
    • 62 Posts
    Hello Community,

    I racked my brain about this issue but I can’t find what I did wrong - so I need your help.

    I’ve created my own 3PC and I want to get it packed. I use the following build script:
    http://downloads.josefbrandl.com/forum_posts/2010-02-23/build_transport_php.zip


    When I install it I get this blue error message in the console:


    The menu entry doesn’t show up properly (lacks title). When I check this in the database, I see that it hasn’t been set.



    Why?
      • 3749
      • 24,544 Posts
      I don’t see anything wrong with what you’re doing.

      Try moving this line down further in the code:
      $builder->buildLexicon($sources['lexicon']);


      Put it just above

      $builder->pack();


      That’s where it is in my packages and the lexicon works for me.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 13735
        • 62 Posts
        sry I was ill... ah jou - this was on purpose. Otherwise I get this:


        Damn it what’s wrong...
          • 26903
          • 1,336 Posts
          In my components build I do this :-
          $menu->addOne($action);

          rather than this that you are doing :-
          $action->addMany($menu,’Menus’);


          I have other differences in my build script as well, I attach the action to the menu and create a menu vehicle, you seem to reverse this and create an action,
          not sure if this is your prob though. I’ve attached my build script for the Provisioner component for your perusal, hope it helps.



            Use MODx, or the cat gets it!
            • 13735
            • 62 Posts
            Quote from: shamblett at Feb 25, 2010, 03:15 PM

            I have other differences in my build script as well, I attach the action to the menu and create a menu vehicle, you seem to reverse this and create an action,
            not sure if this is your prob though. I’ve attached my build script for the Provisioner component for your perusal, hope it helps.


            Okay I guess my way (or the manual’s way) is the other way around, but I suppose both ways work. I now do it your way because I like it more. Unfortunately it doesn’t solve the problem. I guess the main problem is, that as primary key an empty string for whatever reason is inserted into the table.
            Why do we need
            $menu->fromArray($array,'',true,true);
            Why isn’t a
            $menu->fromArray($array);
            sufficient?

            Can you post the field array for you component?

            Why do you set xPDOTransport::PRESERVE_KEYS to true?

            What problems do you have?
            • Quote from: jbjoe at Feb 26, 2010, 05:00 PM

              Okay I guess my way (or the manual’s way) is the other way around, but I suppose both ways work. I now do it your way because I like it more. Unfortunately it doesn’t solve the problem. I guess the main problem is, that as primary key an empty string for whatever reason is inserted into the table.
              Why do we need
              $menu->fromArray($array,'',true,true);
              Why isn’t a
              $menu->fromArray($array);
              sufficient?
              Because when dynamically creating new xPDOObject instances you need to set the primary keys, which xPDOObject::fromArray() will not do unless explicitly told to do so with the third parameter.

              Quote from: jbjoe at Feb 26, 2010, 05:00 PM

              Why do you set xPDOTransport::PRESERVE_KEYS to true?
              This tells the install process to use the primary keys of the stored object explicitly; if false, those objects would get newly generated primary keys when inserted instead of the original keys being preserved.
                • 28215
                • 4,149 Posts
                FYI, I’ve updated those docs to accurately reflect changes in the core model since that tutorial was written.
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 13735
                  • 62 Posts
                  Thank you. I’ve still some problems and will show them later.

                  As for xPDOTransport::PRESERVE_KEYS - well, actually I’ve already read this part and should have known this.

                  And maybe: Could you please put the transport build script tutorial into the Developer’s Guide > Package Management > Transport Packages section or even merge these? I associate a "More Resources" section always with a bunch of noteworthy good off-site tutorials. Just a suggestion...
                    • 13735
                    • 62 Posts
                    Okay...

                    Let me tell you what (I suppose) solved the problem above: I retyped the [tt]’text’ => ’gallerygear’[/tt] part. After that the database entry wasn’t empty anymore. Maybe I had created a false unicode character in my editor due copy pasting from the manual.

                    Now my other problem:
                    When I deinstall my package all the language keys get erased. That’s odd and I can understand if you don’t believe me but here is the proof:




                    File structure hasn’t changed
                    (see pic in first post)

                    The ’en’ language file code:
                    <?php
                    $_lang['gallerygear'] = 'GalleryGear';
                    $_lang['gallerygear_desc'] = 'Manage my GalleryGear pictures.';


                    The ’de’ language file code:
                    <?php
                    $_lang['gallerygear'] = 'GalleryGear';
                    $_lang['gallerygear_desc'] = 'Verwalte meine GalleryGear Bilder.';

                      • 26903
                      • 1,336 Posts
                      Yes, this is a known bug, I think its been fixed in the 2.0 branch, not sure what the JIRA is if any.
                        Use MODx, or the cat gets it!