We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37638
    • 63 Posts
    I've been using MyComponent to package a new site. Up until two nights ago it was working as expected. Now, when running "build" I only get:

    Project: fwa
    Action: Build

    Created Package: fwa
    Created namespace: fwa

    I tried reverting back to a known revision in git, no luck. Reinstalling MC, no luck.

    Thoughts?

    Revo 2.2.7
    MC 3.0.6

    This question has been answered by jmaddington2. See the first response.

      • 38290
      • 712 Posts
      Are you just rerunning build or the other process as well? (Bootstrap, export objects)
        jpdevries
        • 37638
        • 63 Posts
        Yes, and those are running without problems.

        Tried blowing away the assets/mycomponent/fwa directory (fwa = project I am on), re-bootstrapping/exporting. Still no love.

        The example project builds, however...
          • 3749
          • 24,544 Posts
          Is the project config file still in the MyComponent _build/config directory? Did you maybe edit the project config file in the project directory instead of the one in the MyComponent directory? The one in the MyComponent directory is the one that gets used by the utilities when placing the files in their directories.

          Have you changed the target directories in the config file?

          The only thing I can think of that would cause that with no error messages is having your files in the wrong place or having the wrong categories in a package that contains only elements. The build.transport.php script makes most of its decisions on whether certain directories and files exist in the places it's looking for them and it looks like it's not finding anything. In the project _build/config directory, check the categories.php file to make sure the values are correct.
            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
            • 37638
            • 63 Posts
            @BobRay I don't think its changes in the config. I deleted everything under assets/mycomponents/fwa/, then reverted to a known working commit. I re-ran bootstrap & exportobjects without errors. When I try to run build it still outputs the same thing.

            To be clear, that is ALL it is outputting, the source of the page is:

            <br />
            Project: fwa<br />
            Action: Build<br />
            <br />
            Created Package: fwa<br />
            Created namespace: fwa<br />


            Three errors showed in the MODX error log that hadn't been there before:

            [2013-04-21 20:58:32] (ERROR @ /index.php) Could not retrieve data to cache for resource 1
            [2013-04-21 21:02:54] (ERROR @ /index.php) chunk_err_saveArray
            [2013-04-21 21:02:54] (ERROR @ /index.php) template_err_saveArray
              • 37638
              • 63 Posts
              Also, the git repo contains *everything* related to the project, including the project config file.
                • 3749
                • 24,544 Posts
                I could be wrong, but I don't think those errors are related. I think that output is what you would see if the config files were in place, but your project had no components (or the build.transport.php file thought it had no components for some reason).

                Are you running the build from the UI inside MODX?

                When you say you reverted, to you mean you reverted the project directory or the MyComponent directory?

                In the project config file in assets/mycomponents/mycomponent/_build/config/ (*not* the one in your project directory), is the targetRoot directory set to assets/mycomponents/fwa/ ?

                Do you have a PHP debugger, by any chance? Stepping through the build.php file in assets/mycomponents/mycomponent/core/components/mycomponent/elements/snippets/ directory would be the best way to find out what's going on.

                The next best thing would probably be some echo statements in the build.transport.php file in the project's _build directory.

                  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
                  • 37638
                  • 63 Posts
                  Are you running the build from the UI inside MODX?

                  Yes.

                  When you say you reverted, to you mean you reverted the project directory or the MyComponent directory?

                  The namespace I am working on is fwa, I reverted assets/mycomponents/fwa/ & core/components/[...]/fwa.config.php

                  In the project config file in assets/mycomponents/mycomponent/_build/config/ (*not* the one in your project directory), is the targetRoot directory set to assets/mycomponents/fwa/ ?

                  That is unchanged, so yes:
                      /* Define source and target directories (mycomponent root and core directories) */
                      'mycomponentRoot' => $this->modx->getOption('mc.root', null,
                          MODX_CORE_PATH . 'components/mycomponent/'),
                      /* path to MyComponent source files */
                      'mycomponentCore' => $this->modx->getOption('mc.core_path', null,
                          MODX_CORE_PATH . 'components/mycomponent/core/components/mycomponent/'),
                      /* path to new project root */
                      'targetRoot' => MODX_ASSETS_PATH . 'mycomponents/' . $packageNameLower . '/',



                  Do you have a PHP debugger, by any chance? Stepping through the build.php file in assets/mycomponents/mycomponent/core/components/mycomponent/elements/snippets/ directory would be the best way to find out what's going on.

                  After you and Jason tweeted about how great PHPStorm was I tried it out and bought it. I have to yet to configure the debugger in it. I'll probably go with some echo statements and get back to you after that.
                    • 3749
                    • 24,544 Posts
                    Check to make sure that you don't have mc.root and mc.core_path System Settings pointing to MyComponent in another location.
                      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
                    • discuss.answer
                      • 37638
                      • 63 Posts
                      Ok, I think I narrowed it down to

                          'exportResources' => array(
                              'Submit Tip',
                      //        'Pray Now',
                          ),


                      When 'Submit Tip' is uncommented, it fails. When it is commented it does not.

                      'Submit Tip' is actually the only resource I have that this isn't a regular document, it is a weblink. (Which is also why reverting git didn't affect anything).

                      If you want to do more troubleshooting, or want me to do some to help with MC send me an email.