We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    Quote from: sottwell at Nov 23, 2006, 01:52 AM

    (the "helper" document sys_evt.html is in the wizard/tpl folder, not the wizard/ folder per line 116 of forms.tpl, so it causes a 404 error)

    oh... yes it is... damn, I missed that. thanks. I will fix this when I get home and post a new version.
    now everyone that has this installed will get to use the nifty self update feature.

    later

    -sD-
    Dr. Scotty Delicious.com
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: PaulGregory at Nov 23, 2006, 06:14 AM

      I dislike those modules that check for the existence of a table every time they run.
      Just an FYI, moving forward, MODx will attempt to create/alter tables if they are missing or a full result set doesn’t match the structure map for that table. There is no extra query unless an error is detected on an existing query to that table, so there is 0 performance impact. So I’d say this particular concern is really not an issue, and I’d prefer if data structure issues were delegated to the persistence layer, and were not dependent on installation/upgrade processes directly. This is not to say that we can’t still have external scripts (PHP or SQL) to handle more complex data structure issues, auto-create or alter tables, etc., during installation/upgrade. Just wanted to make it clear how that issue is being approached for the future.
        • 22815
        • 1,097 Posts
        Eh? My concern is that the bit in some modules that creates a table if it doesn’t exist, and by checking the existence each time is therefore an extra hit on the DB here today with MODx as it is now.

        If in the future, that is made redundant by some structure map declaration, then it seems even more like a good idea to move the SQL setup to a separate file, because such things wouldn’t be in the module/snippet. I am in favour of a separate set-up script because it gives a greater amount of flexibility right now - checking for a table, checking for older version of table to add new columns etc.

        Unfortunately your post is one of those ones that fills me with dread rather than hope. What the hell is the persistence layer? Why should a data structure not be created at the point of install? What is the difference between an install/upgrade and the introduction of a new/revised structure map into the system? From the point of view of a non-techie installing a snippet through a WIZARD, would you not expect all required data structures to be set up during install - whether it’s by a script with SQL statements (or API calls, if you want to abstract things) or a part of xPDO acting upon a newly provided structure map? I can see that it duplicates a benefit from the future MODx, but as all I’m talking about is moving code from one script to another, I don’t see how it’s not worthwhile.
          No, I don't know what OpenGeek's saying half the time either.
          MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
          Forum: Where to post threads about add-ons | Forum Rules
          Like MODx? donate (and/or share your resources)
          Like me? See my Amazon wishlist
          MODx "Most Promising CMS" - so appropriate!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I think what Jason is saying is fine, on installation have a way to install any tables and whatnot. But there will be no need for checking every time the installed snippet/module/plugin is run, because it will automatically trap any errors, and at that point update or install whatever is missing and causing the error.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 26435
            • 1,193 Posts
            @ Jason, Paul, and Susan:

            I totally agree with both of you. grin

            -sD-
            Dr. Scotty Delicious, Scientist.
              Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
              All of the above... in no specific order.


              I send pointless little messages
              • 26435
              • 1,193 Posts
              I don’t think it would be hard to implement this as an optional field int the "make new pakage" form. A resource creator can put raw sql code into this textarea. on form post, the content of that textarea will be written to a file called "mrw.sql". if the textarea value ="", no file will be created, and no reference to $resource_sql will be made in install.php. Paul, do you think this would work in your picture of where this is going (or should be going) .

              @ All... suggestions and ideas are expected....

              -sD-
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 22815
                • 1,097 Posts
                Maybe I misinterpreted Jason’s "So I’d say this particular concern is really not an issue"; my post seems overly vicious in retrospect.

                Yes, I think the .sql file is broadly similar to the future method of including a structure map, and I think it’s a simple solution to people’s needs right now. Raw SQL has one flaw though - it does not account for the db prefix. To be fair, some existing add-ons don’t account for it. Perhaps users should use modx_dbtable and then this could be replaced before execution.

                I outlined a run-once script. I *also* like the idea of a separate run-once script, although I can’t actually think of a particular use for it right now. Maybe creating a folder or clearing the cache or something.

                Where do I think this should be going? Well, I guess I just think that a Resource Wizard should be capable of wizard-ing as many installation steps as possible - making things as simple as when they are selected during in the MODx install.

                I’ve not actually released anything that would be require a Resource Wizard yet, but the existence of this does make it more likely that I will. I know that large parts of this will be made redundant in the near future, but it is still a worthwhile exercise. Thanks to all concerned.
                  No, I don't know what OpenGeek's saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 26435
                  • 1,193 Posts
                  Quote from: PaulGregory at Nov 23, 2006, 06:38 PM

                  Yes, I think the .sql file is broadly similar to the future method of including a structure map, and I think it’s a simple solution to people’s needs right now. Raw SQL has one flaw though - it does not account for the db prefix. To be fair, some existing add-ons don’t account for it. Perhaps users should use modx_dbtable and then this could be replaced before execution.

                  Exactly what I was saying in an earlier post. the content creator could put [dbpre]site_snippets as the table, and before the sql is run, MRW could str_replace ’[dbpre]’ for the actual database_prefix from the config.inc.php file.

                  I will try to work all this out and post a new version tonight.

                  @Paul: Did you download and run this bootstrap package yet?

                  -sD-
                    Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                    All of the above... in no specific order.


                    I send pointless little messages
                    • 22815
                    • 1,097 Posts
                    Or, if the content creator forgets and puts modx_whatever, it could come back and suggest the [dbpre] version.<br /><br />Have I tried this thing yet? No, and I’m going to shut up until I have, although if you want to PM me details of one with an SQL bit I might wrap up the AjaxPoll thing I did once.
                      No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                      Forum: Where to post threads about add-ons | Forum Rules
                      Like MODx? donate (and/or share your resources)
                      Like me? See my Amazon wishlist
                      MODx "Most Promising CMS" - so appropriate!
                      • 14174
                      • 4 Posts
                      Newbie post (we all were one once...)

                      MODx: 0.9.5 rev 2106
                      Php: 5.1.6
                      OS: CentOS
                      MODx Resource Wizard: 1.8.5

                      Per the docs, I copied the "/install" directory to site root & ran http:/mysite.com/install - module seemed to install correctly, present in Modules|Manage Modules. However selecting the module from the menu bar brings up a blank page (http://mysite.com/manager/index.php?a=112&id=4). I deleted the module using the "manage modules" and reinstalled, but still no success.

                      Any suggestions?

                      Thank you.