Recommended Posts

I haven't had a chance to play with this yet, but I know it will be used on an upcoming site - just wanted to say how great it looks and most importantly how impressive the documentation looks to be - love the use of Github wiki!

  • Like 1

Share this post


Link to post
Share on other sites

You were probably going to have countless issues if you'd played with it before yesterday as I didn't test across multiple PHP/MySQL versions. (I'm lazy like that.)

But all seems to be good now - lemme know if you bump into any issues.

Was going to host the docs myself... but the tools are there, so use them - hehe!

:)

Share this post


Link to post
Share on other sites

The mapping collection API has been modified:

  1. Method has changed from addCollection() to collection() due to:
  2. the fact that it now picks up if a collection already exists so that it can add data to it.

Docs updated.

(Thanks Dave.)

Share this post


Link to post
Share on other sites

Just fixed up a little issue regarding the first TIMESTAMP column being auto-updated.

Basically swapped the created_at and updated_at columns around, and removed the updated_at = CURRENT_TIMESTAMP bit from the SQL template used for updating mapping collections.

I could have just defaulted to NULL for both of these timestamps, but I think this is better. Who cares about column order, anyway?

Share this post


Link to post
Share on other sites

Okay, so after all those fixes, my testing seems to show that everything is stable. Everyone agree? I'd like to set this to stable in GH and in the directory.

  • Like 1

Share this post


Link to post
Share on other sites

Are we ready to go ahead and make this stable? I haven't encountered any further issues...

Hell yeah. I didn't encounter any further problems, but I haven't done the big test yet. 

  • Like 1

Share this post


Link to post
Share on other sites

I've just installed the module, but it seems the redirect is to late and I get a "Cannot modify header information - headers already sent by" error.

Edit:

Changing the hook from addHook() to addHookBefore() solved the issue.

Share this post


Link to post
Share on other sites

I've just installed the module, but it seems the redirect is to late and I get a "Cannot modify header information - headers already sent by" error.

Edit:

Changing the hook from addHook() to addHookBefore() solved the issue.

What sent headers first?

Share this post


Link to post
Share on other sites

My templates _init.php, but even as I removed that part the rendering of mustache in a appended TemplateFile was earlier than Jumplinks.

Share this post


Link to post
Share on other sites

I see. So there could be a lot of scenarios involved. Think it would be worth it to change the hook to something way early, and then check to see if a page representing the request exists? We could also add a configuration option that defaults the hook to pageNotFound, but allows you to specify if something is rendering output before the 404. Would be a simple checkbox that says, "Check Jumplinks in an early event - this prevents interruptions from other hooks/templates/etc."

What do you think?

Side note: my Redirects module for Bolt ties into a very early app event. Sure, the caveat is that pages that exist with the request uri are ignored, but we could add a simple check. Perhaps it would also perform redirects faster, as less things boot up?

Share this post


Link to post
Share on other sites

I think the hook is the right one, just addHookBefore does force template rendering to wait for your hooked function to finish, while addHook doesn't seem to do this.

Share this post


Link to post
Share on other sites

I think we're ready for stable. I'm first going to switch over to prepared statements - silly me for not doing this first. Once done, I'll switch over to stable.

Share this post


Link to post
Share on other sites

Version Bump to 1.1.0

Module is now stable (it looks to be, at least).

  1. Now using PDO Prepared Statements
  2. Tables honour responsiveness now - there was an issue with tfoot, so I just hid it from mobile...
  3. Various bug fixes
  4. No schema changes

Let me know if you bump into anything weird.  ;)

Oh, and there's this issue - anyone have any input on that? (Personally, I prefer to have full control... Don't really like modules making decisions for me.)

  • Like 3

Share this post


Link to post
Share on other sites

Version Bump to 1.1.1

  1. Using minified JS (manual call)
  2. Refactor SQL object
  3. Various other changes/fixes
  4. No schema changes

(And GitHub is under attack - boy, how I battled to commit the changes... Finally slipped through after about 20 minutes of trying.)

  • Like 2

Share this post


Link to post
Share on other sites

Version Bump to 1.1.2

  1. Correct page-check behaviour (was using name, now using URI)
  2. Use commitJumplink in CSV importer
  3. No schema changes
  • Like 2

Share this post


Link to post
Share on other sites

I actually had to uninstall the module - it was causing excessive mysql database connections (not usage) and my webserver nearly stalled.

Maybe I run into a loop or something?

I was redirecting from an old Drupal website to PW and used about 70 simple type redirects, such as sources  /drupal/page1/   

Got this (on the latest PW dev)

Error:

Exception: SQLSTATE[HY000]: General error: 1116 Too many tables; MySQL can only use 61 tables in a join (in /wire/core/PageFinder.php line 300)

Error:

Exception: DB connect error 1203 - User already has more than 'max_user_connections' active connections (in /wire/core/Database.php line 68)

I cannot say 100% that this was Jumplinks. I just noted that the performance was back to normal after I uninstalled the module.

So this is just for information in case anyone else can confirm this.

Share this post


Link to post
Share on other sites

Thanks for your post. :-)

Looks like another module is doing that. Jumplinks only creates two tables (one for jumplinks, and another for mapping collections).

In terms of performance, I'm unable to test that sort of thing. Are you saying that those errors go away when you uninstall Jumplinks? Do you have the same issue if you use ProcessRedirects?

If you (or anyone else) could provide me with more information, that would be great. Otherwise, I can't determine what's going on.

Share this post


Link to post
Share on other sites

On the topic of performance, I'm now wondering if I should set up a cache system for Jumplinks. It was mentioned by Antti a while back that Jumplinks is already feature-rich, but I think that caching redirects will actually be a life-saver for some users with large sites. At the end of the day, running the regex engine for every incoming request is sure to be a big performance hit on any server (the way I see it).

I'm sure everyone agrees this should be added?

There are also a few other fixes and enhancements in the pipeline, the most important one involves optional query-strings (much like the QSA flag for mod_rewrite). At the moment, if you want to match something.php and something.php?foo is requested, the redirect will not occur. In order to get it to work, you'd need to add {all} on the end of the source URI, which is, quite frankly, not the best way of doing it.

  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.1.16
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
    • By MoritzLost
      UPDATE: I have published a stable version of this module!
      Discussion thread:
      Github: https://github.com/MoritzLost/TextformatterPageTitleLinks
      ---
      Hello there,
      I'm working on a tiny textformatter module that searches the text for titles of other pages on your site and creates hyperlinks to them. I'm not sure if something like this exists already, but I haven't found anything in the module directory, so I wrote my own solution 🙂
      It's not properly tested yet and is still missing some functionality I would like to implement, so at the moment it should be considered in BETA. Features include limiting the pages that will get searched by template, and adding a custom CSS class to the generated hyperlinks. As I'm writing this I noticed that it will probably include unpublished and hidden pages at the moment, so yeah ... it's still in development alright 😅
      You can download the module from Github:
      https://github.com/MoritzLost/TextformatterPageTitleLinks
      There's some more information in the readme as well.
      Anyway, let me know what you think! I'm happy about any feedback, possible improvements or ideas on how to improve the module. Cheers.
    • By blad
      Hi guys!
      I just uploaded a module to explore files based on elFinder. By default it will show the "Files" folder.
      Screenshots:

      Video:
       
      To do:
       More options To fix:
       The function of rotating or scaling an image fails  Image editors V 1.01 (view issue)
      Fixed the bug working with the Multi-Language support ( translation of folders ). Fixed the name of elfinder.en  Github:
      https://github.com/LuisSantiago/ProcessElFinder/
      I hope you like it.
    • By BitPoet
      I'm really in love with FormBuilder, but the one thing missing to match all my end users' expectations were repeatable field groups. Think repeaters, in ProcessWire terms. Our primary application of PW is our corporate intranet, so "lines" of fields are quite common in the forms I build. We have all kinds of request forms where the information for a varying number of colleagues needs to be entered (from meal order to flight booking request) and where it is simply impractical to send a form for each, and I don't want to clutter my forms with multiple instances of fields that may only get used ten percent of the time.
      That's why I started to build FormBuilderMultiplier (link to GitHub).
      What it does:
      Adds an option to make a regular Fieldgroup repeatable Lets you limit the number of instances of a Fieldgroup on the form Adds an "Add row" button the form that adds another instance of the Fieldgroup's fields Adds a counter suffix at the end of every affected field's label Stores the entered values just like regular fields Makes the entered values available in preview and email notifications Supports most text based fields, textareas and selects (really, I haven't had enough time to test all the available choices yet) What it doesn't do (yet):
      Support saving to ProcessWire pages (i.e. real Repeaters) I haven't tested all the validation stuff, Date/Time inputs etc. yet, but since I'm utterly swamped with other stuff at work, I didn't want to wait until I have it polished. Any feedback is welcome. There might also be some issues with different output frameworks that I haven't encountered yet. The forms I work with mostly use UIKit.
      Status:
      Still alpha, so test well before using it in the field.
      Known issues:
      When rows are added, the form's iframe needs to be resized, which isn't completely clean yet.
      How it works:
      The Fieldgroup settings are added through regular hooks, as is the logic that adds the necessary field copies for processing the form and displaying previews.
      "Multiplied" field instances are suffixed with _NUM, where NUM is an incremental integer starting from 1. So if you have add two fields named "surname" and "givenname" to a fieldgroup and check the "multiply" checkbox, the form will initially have "surname_1" and "givenname_1" field (I'm still considering changing that to make the risk to shoot oneself into the foot by having a regular "surname_1" field somewhere else in the form less likely).
      When a "row" is added, the first row is cloned through JS and the counter in the fields' IDs, names and "for" attributes as well as the counter in the label are incremented before appending the copies to the Fieldset container in the form.
      To keep backend and frontend in sync, a hidden field named [name of the fieldset]__multiplier_rows is added to the form. Both the backend and the frontend script use this to store and retrieve the number of "rows".
      ToDo:
      Naturally, add the option to store the data in real repeaters when saving to pages. Do a lot of testing (and likely fixing). Make a few things (like the "Add row" button label etc.) configurable in field(set) context. Add a smooth API to retrieve the multiplied values as WireArrays. The mandatory moving screenshot: