We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24882
    • 4 Posts
    I’m trying to implement this and have a weird issue which is probably a ’general’ rather than a pkBlog issue but:
    On my page I see the code rather than the interpreted output. This is NOT because I used the RichText editor; I pasted the code in using no rich text.

    Screenshot attached

    Any ideas? What sort of things should I check? I’m new to modX but I did manage to template the rest of the site in a few hours. Now I’m building a blog it’s getting a bit tricky smiley

    retrocool
      • 16183
      • 1,390 Posts
      Hi retrocool

      That could happen if you have spaces between the [ like so [ [. Is that the case?

      Btw, not the cause for the problem you have, but I think you need to call PubKitBlog uncached, like so

      [!PubKitBlog? etc etc... !]


      Welcome to MODx!

      cheers/k
        • 16278
        • 928 Posts
        @retrocool: I’ve just started setting up a demo site on a subdomain, and I’m hitting the same thing. Fascinating! (where "Interesting" = I have no idea what’s going on here).

        One thing I do notice is that the snippet call as reproduced on the page differs from what’s in the document - mine is uncached in the original, and cached in what comes out. So MODx is doing something to the call, though it’s not running the code.

        Inspector Pog is on the case... huh
        KP
          • 24882
          • 4 Posts
          "mine is uncached in the original, and cached in what comes out"

          Yes, that’s what I’m seeing. But when I replaced pkBlog? with a snippet name which did not exist eg notRealSnippet? it did the same thing, so I don’t think it’s calling pkBlog to do that.

          I changed the name of the pkBlog snippet and then changed the name in my call (to make *sure* it was calling the right snippet, although it *appeared* to be the same names). This seemed to do ~something~ because now I get:

          Fatal error: Class ’OptionButtons’ not found in /home/myusername/public_html/manager/includes/document.parser.class.inc.php(770) : eval()’d code on line 49
            • 24882
            • 4 Posts
            It may possibly be helpful to know that I originally installed modx on a subdomain and then moved it. That was before trying pkBlog, tho, and moving it did not bring any other issues.
              • 16278
              • 928 Posts
              Gotcha! Two problems:
              1) Syntax error in the snippet code. I had &tagFormat where it should have been $tagFormat around line 84. I had also failed to run a syntax check in my PHP editor (tsk tsk) and hadn’t updated my own live snippet code with the new version when testing (tsk tsk tsk). Will upload v1.2.1 soonest with the correction.

              2) Above had no impact until the simple but far from obvious error in the snippet call was fixed. I had pasted in the call from the PDF file, but didn’t realize that I’d also pasted in a couple of newlines. I detected this when I removed parameters one by one until the call was on one line. Then a little bell rang at the back of my head - I thought I’d seen this before! Normal behaviour for a snippet that doesn’t work (e.g. uncorrected v1.2 snippet code) is to return and error report or nothing, not the text of the snippet call. Maybe I should revert to supply the key docs as a separate text file.

              The Fatal Error problem sounds more standard - is the optionsbuilder class file in the right place?

              rolleyes KP
                • 24882
                • 4 Posts
                Well it’s at:
                public_html/assets/snippets/pubKit/optionsbuilder.class.php
                Was I supposed to copy this into the database as well as upping the file?
                  • 16278
                  • 928 Posts
                  I have installed pkBlog on a greenfield site that is to become a demo for it and other parts of PubKit, and realized when I tried to re-edit items or publish ones with mandatory fields missing that it has so far been dependent on the PHx plugin to work fully in the form display. This is corrected in v 1.3, which is now attached to the original post. Changes of substance are in the form file (chunk.blog.html) and the main include file (pubKitBlog.inc.php), and the version number has been updated in the snippet text file.

                  It has also emerged that if you copy and paste snippet calls from the PDF installation document, you will include some unwanted newlines in them. You need to get rid of them - they will prevent the calls from working (you just get the text of the call back instead of the result of the snippet).

                  @retrocool: if the class file is in the right place (and I suppose the error would actually be "file not found" if it wasn’t), then I suggest you check the lines that should include it (after the parameter comments near the beginning of the snippet).

                  smiley KP
                    • 16278
                    • 928 Posts
                    pkBlog is now at version 1.4.1, attached to OP.
                    Latest changes:

                    • Fixed permalink bug - will now pick up new doc’s ID to ensure unique URL (was getting the post form’s ID);
                    • Tag retrieval on re-edit fixed properly - getting the stored value with docmanager always retrieves options with raw "||" delimiter, no widgetry turning it into your chosen delimiter as I had thought;
                    • Added a placeholder so you can insert introtext into main body of item on publication. I found I was continually copying and pasting the introtext, so now you can just enter +intro+ as a placeholder for it. Standard [+introtext+] doesn’t work in this context.
                    Versions 1.2 and 1.2.1 (which corrects a typo in 1.2) are both in the repository as separate items. If anyone can tell me how to update the package there, I’d be glad to know. Do I need to get a higher-powered login or something? Currently if I try the Update buttons nothing actually happens.

                    To see what would make it easier to set up and try out, I installed the blog into a fresh MODx installation (with standard MODx sample content). Got a horrific mess because of clashes between my CSS and the site.css template, so I have added sample main site template and CSS for pkBlog. I’ve also relocated chunk and template sample files to pubKit/chunks and /templates, which seems a more natural place to look for them.

                    I’ve started a demo mini-site at http://pubkit.pogwatch.com, where at the moment there’s both a categorized news section and a blog using pkBlog. The news uses a radio-button tag set to assign stories to one of three subsections. If you’d like a login to try the editing facilities and for a read-only view of the manager side, just PM me.

                    laugh KP
                      • 26016
                      • 561 Posts
                      Hi,
                      First, may I say that this is some nice work. I had started with 1.3; I see that with 1.4.1, the install instructions get clearer, and subsequent folks may not have the troubles I did. I am using Evolution, btw, in case that matters.

                      I have 5 tags in my setup. With 1.3, the 5th tag would not display when I tested it; the first 4 were fine. Now with 1.4.1, the fifth tag does work when you enter it with the Post Manage page. Here’s the weird thing... when I go to edit the page from the Manager, the 5th tag is not checked, even though it displays on the site. For fun, I tried checking it and doing a Save... still does not stick (and the 5th tag continues to display anyway)! I guess that’s sort of OK, as long as the person enters the doc from the front end.

                      It’s a little scary that I’m planning to use this with a current client; it looked good enough to take the plunge, and I don’t want to back out now if I can avoid it.

                      If you have any ideas for the "mystery last tag", great.

                      I also noticed that when I entered a Blog title with an apostrophe, such as "I’ve entered Catherine’s room", the apostrophe is escaped, so that you get this: "I\’ve entered Catherine\’s room". That’s a very traditional PHP error, and I can fix that pretty easily myself, I’m sure, and I’ll see if I might need to do it in other fields. smiley

                      Thanks for the app,
                      Dave
                        MODx and Wordpress development
                        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4