Mike Rockett

module
Jumplinks

441 posts in this topic

5 hours ago, Mike Rockett said:

@Joss Hi - that's a legacy error from an earlier version of MySQL. What version are you running?

This is on a shared server and according to phpmyadmin, it is  5.1.73

Share this post


Link to post
Share on other sites

@Mike Rockett - Apparently, that error will also show on 5.5, which is what the server is running, the company have told me. I will probably migrate at some point.

Share this post


Link to post
Share on other sites
50 minutes ago, Joss said:

@Mike Rockett - Apparently, that error will also show on 5.5, which is what the server is running, the company have told me. I will probably migrate at some point.

I'd be inclined to switch to a newer version. Even 5.6.5, which is when they changed it, is considerably old now. Due to its age, I don't plan on supporting it.

In the interim, you could always try removing DEFAULT CURRENT_TIMESTAMP from the schema file (schema-create-mc.sql) before installation as the insert statement does force it. Untested, but it should work in theory.

Share this post


Link to post
Share on other sites

When I installed this module on my pw site, I got following two erros

 Module reported error during install (ProcessJumplinks): SQLSTATE[HY000]: General error: 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Failed to init module: ProcessJumplinks - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lara_db.process_jumplinks' doesn't exist

pw 2.8.35
php 5.5.9
mysql 5.5.55

 

Share this post


Link to post
Share on other sites
On 7/12/2017 at 2:54 AM, adrianmak said:

When I installed this module on my pw site, I got following two erros

 Module reported error during install (ProcessJumplinks): SQLSTATE[HY000]: General error: 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Failed to init module: ProcessJumplinks - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lara_db.process_jumplinks' doesn't exist

pw 2.8.35
php 5.5.9
mysql 5.5.55

 

Hi there - you will need to upgrade your version of MySQL. Version 5.5 is no longer supported, since end-2015. I recommend you use MySQL 5.7, or switch to MariaDB.

Share this post


Link to post
Share on other sites

Hi Mike

I have a multi-lingual MODX site which I've rebuilt in Processwire.

PW site isn't live but is on a test server.

As the MODX version currently has around 500 resources (lets say 500 URIs) I am keen to follow the old alleged Abraham Lincoln advice

Quote

Give me six hours to chop down a tree and I will spend the first four sharpening the axe.

I'm thinking of doing following and wanted to sanity check my approach

1. Get a sitemap of the entire MODX site into a XLS or CSV and import into Jumplinks

2. Manually go through each "old" URL and update to the new URL

Am I missing something crucial apart from keeping an eye on Google's Search Console (was Webmaster tools) and watching for 404 hits. I'll enable 404 monitoring on Jumplinks too.

Cheers for any pre flight advice. 

 

 

1 person likes this

Share this post


Link to post
Share on other sites
6 minutes ago, Peter Knight said:

Hi Mike

I have a multi-lingual MODX site which I've rebuilt in Processwire.

PW site isn't live but is on a test server.

As the MODX version currently has around 500 resources (lets say 500 URIs) I am keen to follow the old alleged Abraham Lincoln advice

I'm thinking of doing following and wanted to sanity check my approach

1. Get a sitemap of the entire MODX site into a XLS or CSV and import into Jumplinks

2. Manually go through each "old" URL and update to the new URL

Am I missing something crucial apart from keeping an eye on Google's Search Console (was Webmaster tools) and watching for 404 hits. I'll enable 404 monitoring on Jumplinks too.

Cheers for any pre flight advice. 

Hi Peter

  1. Can any of these resources/uris be combined into a pattern? If there are 500 resources, I'm sure the tree can be simplified somewhat, albeit aside technicalities such as the difference in how the two platforms create URIs (or if they've been manually set in modx).
  2. If you do a sitemap, how will you generate new uris to map to PW Pages?

At the end of the day, as long as things match up, I don't see any further issues. Not sure on how Modx works (I tried it once, didn't like it), but keep an eye out for trailing slashes as well.

In your specific instance, the 404 monitor is limited to 100 - you'd need to change the code to get it to show more, and that might be client-resource-intensive. JL2 will handle this better.

1 person likes this

Share this post


Link to post
Share on other sites
18 hours ago, Mike Rockett said:

Hi Peter

  1. Can any of these resources/uris be combined into a pattern? If there are 500 resources, I'm sure the tree can be simplified somewhat, albeit aside technicalities such as the difference in how the two platforms create URIs (or if they've been manually set in modx).
  2. If you do a sitemap, how will you generate new uris to map to PW Pages?

At the end of the day, as long as things match up, I don't see any further issues. Not sure on how Modx works (I tried it once, didn't like it), but keep an eye out for trailing slashes as well.

In your specific instance, the 404 monitor is limited to 100 - you'd need to change the code to get it to show more, and that might be client-resource-intensive. JL2 will handle this better.

Hi Mike

I think I'll prioritise the 100 or so most important URLs and then I can work through the others gradually. Client confirmed that actually they don't rank terrible well anyway so it looks like a relatively fresh start and the pressure is off.

Just have to upgrade to MySQL 5.6 as it's currently running 5.1.X


 

1 person likes this

Share this post


Link to post
Share on other sites

Hello Mike,

I'm trying to run Jumplinks on a server running MySQL 5.7.16, and I keep getting this error from ProcessWire:

Failed to init module: ProcessJumplinks - SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'last_hit'

This is Jumplinks version 1.5.48. We used the same version of the module on another site on the same server within the last few months, and it's working fine there - so I can't understand why this isn't working. It allows me to add redirects, but they don't redirect when loaded. I was also unable to edit the module configuration from the Manage Jumplinks page - the url changed to root/module/edit?name=ProcessJumplinks, and then gave the error "Unrecognized Path". 

 

If you have any insight you could offer, I'd be most appreciative! Thanks.

Share this post


Link to post
Share on other sites

Hi @melody - thanks for the post. This has popped up before, and still not sure as to why. When it happened, I asked Zeka to delete the last_hit column and refresh the modules. It turns out that he had to delete the process_jumplinks_nf table as well, and it started to work properly. Why that is the case, I still do not know... 

You can follow the brief thread from here to see what happened: 

Let me know if those steps work for you. You might land up having to add the nf table manually and increasing the schema version in the module's configuration via phpMyAdmin or whatever tool you use to manually edit DBs.

 

1 person likes this

Share this post


Link to post
Share on other sites

Hi @Mike Rockett -- @melody and I took a look at this this morning. It looks like this is an issue with 0000-00-00 00:00:00 null dates in our strict MySQL environment. After replacing the NULL_DATE constant at the top of the module file with 'CURRENT_TIMESTAMP' and replacing the 0000-00-00 00:00:00 dates in Blueprints/schema-update-v2.sql and Blueprints/schema-update-v3.sql with the same, the problem went away after re-installing the module.

Hope that helps.

1 person likes this

Share this post


Link to post
Share on other sites
1 hour ago, thetuningspoon said:

Hi @Mike Rockett -- @melody and I took a look at this this morning. It looks like this is an issue with 0000-00-00 00:00:00 null dates in our strict MySQL environment. After replacing the NULL_DATE constant at the top of the module file with 'CURRENT_TIMESTAMP' and replacing the 0000-00-00 00:00:00 dates in Blueprints/schema-update-v2.sql and Blueprints/schema-update-v3.sql with the same, the problem went away after re-installing the module.

Hope that helps.

Thanks for letting me know. This date story has me in a tizz because I'm not seeing the correct way to use [auto-updating] timestamps and still support all MySQL enviros... Unless I'm missing something here. Had the same issue with Laravel, and they had to introduce nullableTimestamps() into the schema system. I'm actually using Illuminate for Jumplinks 2, but not sure if it'll work in every environment...

Share this post


Link to post
Share on other sites

Hi Mike

I'm creating Jumplinks for a multilingual site and I was wondering what you advise when I come across a URL like following in the 404 monitor

/it/products/hooks/ganci-piatto/182728

That's an old URL from the italian tree of the site

The reason I'm asking is because when I browse to tree or auto-complete, I can pull up the 1827288 product page but it's not necessarily italian.

Should I manually Specify a destination in these cases and ensure we're manually pointing at the correct launguage?
 

Share this post


Link to post
Share on other sites
16 hours ago, Peter Knight said:

Hi Mike

I'm creating Jumplinks for a multilingual site and I was wondering what you advise when I come across a URL like following in the 404 monitor

/it/products/hooks/ganci-piatto/182728

That's an old URL from the italian tree of the site

The reason I'm asking is because when I browse to tree or auto-complete, I can pull up the 1827288 product page but it's not necessarily italian.

Should I manually Specify a destination in these cases and ensure we're manually pointing at the correct launguage?
 

Hi Peter,

From the top of my head, you could potentially use mapping collections to make it language aware; however, that means importing the entire dataset and using multiple languages - one collection for each language. How are your other URIs being handled?

Share this post


Link to post
Share on other sites
On 14/08/2017 at 7:07 AM, Mike Rockett said:

Hi Peter,

From the top of my head, you could potentially use mapping collections to make it language aware; however, that means importing the entire dataset and using multiple languages - one collection for each language. How are your other URIs being handled?

Hi Mike

each language is handled by a folder named after the language

domain.com/fr/ 
domain.com/de/ 
domain.com/it/ 
domain.com/es/ 

 

Share this post


Link to post
Share on other sites
9 hours ago, Peter Knight said:

Hi Mike

each language is handled by a folder named after the language

domain.com/fr/ 
domain.com/de/ 
domain.com/it/ 
domain.com/es/ 

 

You're probably going to need to do it manually. As Jumplinks 1 is not multi-lang-aware, there's no way for the destination field to know which language you need, unless you declare it manually, or by means of a mapping collection, one for each language. Destination selectors won't help as they are also not aware of languages.

So your collection could be called "italian", and would contain this:

100=/it/uri/to/page
101=/it/uri/to/other/page
102=/it/uri/to/product

And then define the language jumplink:

Source: it/{all}/{id}
Destination {id|italian}

This assumes that your ids are all different between content types (like product, etc.). You would also need to build your collections via a script, and that would require each destination page having a field with the old ID.

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 zlitrox
      Hi!
      I'm relatively new to the world of Processwire, but so far I'm really impressed by this CMS and its ease, power and speed.
      I've been looking at the different field types and also existing CKEditor modules (pwimage and pwlink).
      Here's what i want to achieve:
      I would like to use or create a own module which allows my admin users to upload pdf files inline in a CKEditor field (page content) the same way images are handled. It should be possible to upload a pdf file and specify its name and from the file uploaded and name i want to show an icon or image inline in editor and the output for that upload should be customized based on the module. Lets make it simple and say that i upload datasheet-1.pdf and want it to be named "My product datasheet", i want the output to be:
      <a href="{ link to uploaded pdf file }">My product datasheet</a>  
      Also the uploaded pdf files should be related to the page the user is editing.
       
      Is this doable? 
       
      Any guidance would be greatly appreciated! Thanks in advance.
      PS. I'm a PHP programmer so i know it would require some custom code, but the real question is where do i start, what should it take and is it even possible to do?
    • By flydev
      Auth2Login for ProcessWire
      A Module which give you ability to login an existing user using your favorite thrid-party OAuth2 provider (i.e. Facebook, GitHub, Google, LinkedIn, etc.)..
      You can login from the backend to the backend directly or render a form on the frontend and redirect the user to a choosen page.
      Built on top of ThePhpLeague OAuth2-Client lib.
      Registration is not handled by this module but planned.
       
      Howto Install
      Install the module following this procedure:
       - http://modules.processwire.com/modules/oauth2-login/
       - https://github.com/flydev-fr/OAuth2Login
      Next step, in order to use a provider, you need to use Composer to install each provider
      ie: to install Google, open a terminal, go to your root directory of pw and type the following command-line: composer require league/oauth2-google
      Tested providers/packages :
          Google :  league/oauth2-google     Facebook: league/oauth2-facebook     Github: league/oauth2-github     LinkedIn: league/oauth2-linkedin
      More third-party providers are available there. You should be able to add a provider by simply adding it to the JSON config file.

      Howto Use It
      First (and for testing purpose), you should create a new user in ProcessWire that reflect your real OAuth2 account information. The important informations are, Last Name, First Name and Email. The module will compare existing users by firstname, lastname and email; If the user match the informations, then he is logged in.
      ie, if my Google fullname is John Wick, then in ProcessWire, I create a new user  Wick-John  with email  johnwick@mydomain.com
      Next step, go to your favorite provider and create an app in order to get the ClientId and ClientSecret keys. Ask on the forum if you have difficulties getting there.
      Once you got the keys for a provider, just paste it into the module settings and save it. One or more button should appear bellow the standard login form.
      The final step is to make your JSON configuration file.
      In this sample, the JSON config include all tested providers, you can of course edit it to suit your needs :
      { "providers": { "google": { "className": "Google", "packageName": "league/oauth2-google", "helpUrl": "https://console.developers.google.com/apis/credentials" }, "facebook": { "className": "Facebook", "packageName": "league/oauth2-facebook", "helpUrl": "https://developers.facebook.com/apps/", "options": { "graphApiVersion": "v2.10", "scope": "email" } }, "github": { "className": "Github", "packageName": "league/oauth2-github", "helpUrl": "https://github.com/settings/developers", "options": { "scope": "user:email" } }, "linkedin": { "className": "LinkedIn", "packageName": "league/oauth2-linkedin", "helpUrl": "https://www.linkedin.com/secure/developer" } } }  
      Backend Usage
      In ready.php, call the module :
      if($page->template == 'admin') { $oauth2mod = $modules->get('Oauth2Login'); if($oauth2mod) $oauth2mod->hookBackend(); }  
      Frontend Usage
      Small note: At this moment the render method is pretty simple. It output a InputfieldForm with InputfieldSubmit(s) into wrapped in a ul:li tag. Feedbacks and ideas welcome!
      For the following example, I created a page login and a template login which contain the following code :
      <?php namespace ProcessWire; if(!$user->isLoggedin()) { $options = array( 'buttonClass' => 'my_button_class', 'buttonValue' => 'Login with {provider}', // {{provider}} keyword 'prependMarkup' => '<div class="wrapper">', 'appendMarkup' => '</div>' ); $redirectUri = str_lreplace('//', '/', $config->urls->httpRoot . $page->url); $content = $modules->get('Oauth2Login')->config( array( 'redirect_uri' => $redirectUri, 'success_uri' => $page->url ) )->render($options); }

       
      Screenshot
       



    • By Robin S
      First a note about my other modules...
      I have three existing modules that are similar in that they allow restrictions to be placed on repeating inputfields: Limit Repeater, Limit PageTable, Limit Table
      Restrict Repeater Matrix takes a different approach to the module configuration from those other modules. The module settings for Restrict Repeater Matrix are applied in the field settings rather in a module config screen. I think this new approach is better, but it means that it isn't practical to create different settings for different roles via the admin interface. Instead the module has a hookable method, allowing roles to be targeted and other advanced usages to be achieved via a hook. The result is that the module is more flexible.
      I intend to transition my other modules to the same approach over the coming weeks, but because this will result in breaking changes I will be releasing the updated modules under new names ("Restrict Repeater", etc) to avoid users upgrading via the Upgrades module without full awareness of the changes. The old modules will be marked as deprecated.
       
      Restrict Repeater Matrix
      A module for ProcessWire CMS/CMF. Allows restrictions and limits to be placed on Repeater Matrix fields. Requires FieldtypeRepeaterMatrix >= v0.0.4
      For any matrix type in a Repeater Matrix field you have the option to:
      Prevent drag-sorting of items Prevent cloning of items Prevent toggling of the published state of items Prevent trashing of items Limit the number of items that may be added to the inputfield Please note that restrictions and limits are applied with CSS/JS so should not be considered tamper-proof.
      Usage
      Install the Restrict Repeater Matrix module.
      For each matrix type created in the Repeater Matrix field settings, a "Restrictions" fieldset is added at the bottom of the matrix type settings:

      For newly added matrix types, the settings must be saved first in order for the Restrictions fieldset to appear. Set restrictions for each matrix type as needed. A limit of zero means that no items of that matrix type may be added to the inputfield.
      Setting restrictions via a hook
      Besides setting restrictions in the field settings, you can also apply or modify restrictions by hooking RestrictRepeaterMatrix::checkRestrictions. This allows for more focused restrictions, for example, applying restrictions depending on the template of the page being edited or depending on the role of the user.
      The checkRestrictions() method receives the following arguments:
      $field This Repeater Matrix field $inputfield This Repeater Matrix inputfield $matrix_types An array of matrix types for this field. Each key is the matrix type name and the value is the matrix type integer. $page The page that is open in ProcessPageEdit The method returns a multi-dimensional array of matrix types and restrictions for each of those types. An example of a returned array:

      Example hooks
      Prevent the matrix type "images_block" from being added to "my_matrix_field" in a page with the "basic-page" template:
      $wire->addHookAfter('RestrictRepeaterMatrix::checkRestrictions', function(HookEvent $event) { $field = $event->arguments('field'); $page = $event->arguments('page'); $type_restrictions = $event->return; if($field->name === 'my_matrix_field' && $page->template->name === 'basic-page') { $type_restrictions['images_block']['limit'] = 0; } $event->return = $type_restrictions; });  
      Prevent non-superusers from trashing any Repeater Matrix items in "my_matrix_field":
      $wire->addHookAfter('RestrictRepeaterMatrix::checkRestrictions', function(HookEvent $event) { $field = $event->arguments('field'); $type_restrictions = $event->return; if($field->name === 'my_matrix_field' && !$this->user->isSuperuser()) { foreach($type_restrictions as $key => $value) { $type_restrictions[$key]['notrash'] = true; } } $event->return = $type_restrictions; });  
      http://modules.processwire.com/modules/restrict-repeater-matrix/
      https://github.com/Toutouwai/RestrictRepeaterMatrix
    • By psy
      ProcessWire DropboxAPI on GitHub: https://github.com/clipmagic/DropboxAPI
       
      This module is a wrapper for Kunal Varma's Dropbox PHP SDK https://github.com/kunalvarma05/dropbox-php-sdk
      It was created to perform a specific function for a client, ie upload PDF files on a PW website to a specific Dropbox account folder.
      The PDF files, created using @Wanze's excellent PagesToPdf module using the WirePDF functions, are generated from Formbuilder forms completed by front-end site visitors.  Works a treat!
      There's more that could be done to allow ProcessWire to take advantage of all the features of the SDK, eg downloads, multiple Dropbox accounts, etc. You are welcome to request changes and/or fork the GitHub project to extend the feature set.
      Enjoy!
      System requirements
      PHP 5.6.4 or greater Composer The PHP mbstring extension General information
      This module enables you to access a single Dropbox (www.dropbox.com) account to upload files from a ProcessWire website.
      All kudos to (https://github.com/kunalvarma05/dropbox-php-sdk) for the PHP API.
      First steps
      Visit (https://www.dropbox.com/developers) and read the documentation. Log into Dropbox and create a new application. It's recommended to limit ProcessWire App access to a specified folder Make a note of the App key, the App secret and the name of the Dropbox folder Installation
      Download the zip file into your site/modules folder then expand the zip file. Next, login to ProcessWire > go to Modules > click "Refresh". You should see a note that a new module was found. Install the DropboxAPI module. Configure the module with your App key, App secret and your Call Back URL You need to generate a Dropbox access token to enable your site to communicate with the nominated Dropbox account. Dropbox will generate a token for you or you can create a page for the front end of your ProcessWire site with a template to submit the token request to Dropbox, eg:
      <?php namespace ProcessWire; $drop = $modules->get('ProcessDropboxAPI'); if ($input->get->code && $input->get->state) { $code = $sanitizer->text($input->get->code); $state = $sanitizer->text($input->get->state); //Fetch the AccessToken $accessToken = $drop->getAccessToken($code, $state); echo "Copy/paste this code into the module configuration: " . $accessToken; } else { echo "<p><a href='" . $drop->getAuthURL() . "'>Log in with Dropbox</a></p>"; } ?> Once you have entered the token in the module configuration, you can unpublish this page.
      Usage
      Read the dropbox-php-sdk documentation!
      An example template for sending a file to a Dropbox App folder from ProcessWire:
      <?php namespace ProcessWire; use Kunnu\Dropbox\Dropbox; use Kunnu\Dropbox\DropboxApp; use Kunnu\Dropbox\DropboxFile; // send pdf to Dropbox $drop = $modules->get('DropboxAPI'); $app = new DropboxApp($drop->app_key, $drop->app_secret, $drop->authorization_code); if ($app) { //Configure Dropbox service $dropbox = new Dropbox($app); $dropboxFile = new DropboxFile('/path/to/myfilename.pdf'); $file = $dropbox->upload($dropboxFile, "/myfilename.pdf", ['autorename' => true]); //Uploaded File meta data if ($file) { $success = $file->getName() . " uploaded to Dropbox"; $drop->log($success); } }  
       
    • By Sipho
      I recently needed a module that automatically fills the title field of a page using fields on that page. I couldn't see one that already existed so I made my own. This is mostly based on ProcessSetupPageName by @kixe which I use along with this module. Keep in mind I am very new to ProcessWire so perhaps somebody else can contribute or make a better one 
      Note: The title is automatically hidden when using this module
      You can enter any string. To add a fieldname, subfield or property, you surround the fieldname with {}. Dot syntax allowed. Example:
      Fish: {parent.title} {myfield}
      https://github.com/nextgensparx/AutoPageTitles