adrian

Module
Migrator

294 posts in this topic

Hey Joss - thanks for the file.

The issue was with some broken images embedded into your blog posts - some linking to an old joomla site :). Migrator now handles broken images properly so no errors.

I also took the opportunity to add a few more fixes and enhancements to embedded images and captions - links to the original sized version now also work (although I am wondering the best way to add a class for lightbox display of these. I don't want to assume the class that users want, so maybe this needs to be a configurable setting - any thoughts?).

Please try the latest versions of both ProcessMigrator and MigratorWordpress (again from my fork) and let me know how you go.

Here's a screenshot of what one of blog posts looks like for me once imported. Be patient - it can take quite some time to download all those images, but it will work :)

post-985-0-51869800-1417570430_thumb.png

1 person likes this

Share this post


Link to post
Share on other sites

I think with the lightbox side you could add a field for a class, but some lightboxes need more than that and it could get complicated. Maybe a note in the instructions that this might be something better handled with a bit of javascript on the fly. I might find a mix between the two useful - adding a class at processing at least identifies the image and then one could decide what to do later.

On the other hand, a blog might not always have images linked to bigger version - so not sure what to do then....

Share this post


Link to post
Share on other sites

Am not importing a JSON its a wordpress.xml am trying to import to Processwire using Nico's MigratorWordpress. wow that was a fast response

Share this post


Link to post
Share on other sites

Any finally got it to import my contents but i had to comment the following

 
if(empty($fp)){



                $this->error("Missing required ZIP or JSON Source");
                if($this->session->migratorFilesDir && file_exists($this->session->migratorFilesDir)) $this->recursiveDelete($this->session->migratorFilesDir);
                //$this->session->redirect('./'.$this->session->type);
                return $form->render();
            }

Share this post


Link to post
Share on other sites

I am not really sure on why that would happen - did the import actually work properly after commenting out that check?

The fact that $fp is empty at that point in the code suggests that the conversion from the xml into a json file ready for parsing by migrator didn't work. But if it all worked as expected for you, then I'll just add it to my list of things to keep an eye on.

Share this post


Link to post
Share on other sites

Ignore what i wrote it imported also without the comment, am still going to look at it again in the morning take care

Share this post


Link to post
Share on other sites

I am not sure why you are getting that missing required zip or json error, but it would be helpful if you could PM me the xml file so I can test. 

I don't really understand what is wrong in the second image you posted.

To attach images here, you need to click the "More Reply Options" button.

Share this post


Link to post
Share on other sites

Thanks - I have been doing lots of testing with your file and can't replicate the "missing required zip or json" error. I did however find some bugs regarding image import in certain situations that I have just fixed, so please grab the latest versions of both Migrator and MigratorWordpress.

I will send some screenshots showing the properly imported content in reply to the PM you sent.

In an attempt to figure out why you are getting that error, can you please try logging the value of: $this->session->jsonFilename and also uncomment the exit on line 882. Then make sure that there is some json content in the file at the path that should be stored in: $this->session->jsonFilename

Share this post


Link to post
Share on other sites

Thanks now i am more encourage knowing it works on your end. I will do as specified and debug it and monitor the variables. I wanted to be sure I wasn't an exception thanks alot andrian.

1 person likes this

Share this post


Link to post
Share on other sites

While trying to get some contents into my site i got the following issue, been familiar with PHP Development I tried looking for codes that tried to do the similar:

$SessionFakeObject->set('keyStore',$DatabaseInstance);

As the above will cause the $DatabaseInstance to be serialized which is not allowed, however I have tried debugging and can't really point what could be the cause (also my Zend Debugger is busted) so if anyone has experienced such error please respond so i look at how to fix it. 

As for the previous error am behind a Firewall so that's explainable

post-2850-0-03174200-1419933727_thumb.pn

Share this post


Link to post
Share on other sites

Sepiroth - I moved your post here, because all those relate to Migrator.

The first one regarding Github is surprising - perhaps they were down momentarily. Please let me know if you continue to see that one.

The serialize error is also a mystery to me - I see it occasionally when I use Migrator - it seems to be random and it doesn't seem to affect the import process. I don't do any database serialization in the module at all. I need to investigate further at some point, but I think for the moment it can be safely ignored.

Share this post


Link to post
Share on other sites

Sepiroth - I moved your post here, because all those relate to Migrator.

The first one regarding Github is surprising - perhaps they were down momentarily. Please let me know if you continue to see that one.

The serialize error is also a mystery to me - I see it occasionally when I use Migrator - it seems to be random and it doesn't seem to affect the import process. I don't do any database serialization in the module at all. I need to investigate further at some point, but I think for the moment it can be safely ignored.

The first one is all me I work in Switching company (Online Payment and all), so our firewall is pretty strong so that I know is as a result of the firewall, however the second error which is quite confusing because there's no assign of any Database instance in a session in your code. so am wondering how that's happening. Spent the whole night trying to get my Zend Debugger working but failed once its up i will check the Debug steps. 

Share this post


Link to post
Share on other sites

Okay so i switched to Xdebug and spent the whole night debugging and during the Xdebug it never broke at ll, it converted the code and returned the json and exited as expected. This has nothing to do with the Module/Processwire if not i should have been thrown an exception during the debugging. so i will research more on this but i took out the thirdparty.json it outputted after monitoring the code. will simply import that and move on with life. 

Share this post


Link to post
Share on other sites

All the Post imported into ProcessWire from WordPress thanks alot am really glad thanks for the support.

post-2850-0-38131100-1420126463_thumb.pn

1 person likes this

Share this post


Link to post
Share on other sites

Very glad it is working for you as expected. But I am curious what, if any changes you made. Did the Github issue fix itself?

What about the missing zip/json error - was that just a result of the exit code commenting?

Is there anything else I should know about?

Thanks again for your extensive testing - did you ever figure out anything around that serialization error?

Share this post


Link to post
Share on other sites

The exit code stops the script so it was the main reason i assumed the PDOException halted it but when i commented it, the script works perfectly. I no longer get the Missing Json or Zip Source message. As for the PDO Serialization issue i guess it's something we have to keep in mind, I have researched and scanned all PW source code I can't see any reason why it should. but I will occasionally look into it gradually. 

1 person likes this

Share this post


Link to post
Share on other sites

Hi, I'm trying to import pages with images from a website to another (PW 2.5.3 both) using migrator module, but I get errors and it doesn't work for me.


The errors appear during import.


I set the home as parent and then I click "upload and create content" button and the result are shown in this images.


 


error1a.jpg


 


error1b.jpg


 


 


If instead I check "Edit Imported content", after I click "Upload and create content" button, everything seems to work but in the end of the page I have this error


 


error2.jpg


 


And after when I click "Create Content" I have this one


 


error3.jpg


 


This the first time I use migrator. Thank you for any help.


Share this post


Link to post
Share on other sites

Has anyone tried importing an XML the size of 30mb when i try to nothing happens it just renders the same page. will try increasing my post_max_size and see what happens.

Share this post


Link to post
Share on other sites

Okay so increasing post_max_size works but if it's lower it fails silently so maybe a feature would be a message that checks the size of file against the ini_get('post_max_size') and display that to the user. should i create a pull-request for that ? Happy Sunday

1 person likes this

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 blynx
      Hej,
      just finished the first working version of my photoswipe bundle. https://github.com/blynx/MarkupProcesswirePhotoswipe
      As always any feedback is highly appreciated
      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      It is possible to customize pretty much anything by providing your own templates and scripts.
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen
    • By alexcapes
      Hi,
      I've been invited by Apple to use their 'News' service for a publication in the UK. https://www.apple.com/uk/news/
      A number of CMSs already have plugins to publish content via the API, however Processwire is not one (yet!)
      https://newsresources.apple.com/en/faq/66346243
      It's slightly beyond my technical abilities but would be very interested in anyone that is willing to look at developing a Processwire Module.
      (for reference here is the Apple News API documentation)
      Update: Chapter Three have created a PHP Apple News library here https://github.com/chapter-three/AppleNewsAPI
    • By flydev
      OAuth2Login 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 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('DropboxAPI'); 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 sirhc
      Hi all,
      Im trying to install this core module and got the error of not having the ImageMagick library installed.
      But if im checking for the version of my ImageMagick installed on my server via SSH im getting this response;
      identify -version
      Version: ImageMagick 6.9.4-9 Q16 i386 2016-06-21 http://www.imagemagick.org
      Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
      License: http://www.imagemagick.org/script/license.php
      Features: Cipher DPC 
      Delegates (built-in): bzlib freetype gslib jng jpeg png ps tiff xml zlib
      Does this even mean the library is installed? And if yes, why cant i install my module?
      Pleaassee help me
      Greetz.