Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget link serialized array remains unchanged #4

Open
cfxd opened this issue Feb 25, 2015 · 10 comments
Open

Widget link serialized array remains unchanged #4

cfxd opened this issue Feb 25, 2015 · 10 comments

Comments

@cfxd
Copy link

cfxd commented Feb 25, 2015

Hi @petesaia,

Thank you for the amazing tool and for making it freely available.

I recently encountered an issue where widgets with internal site links do not get corrected character counts in their serialized arrays and they end up breaking after a migration. See here for a more detailed description.

Thanks again for Peach and for looking into this!

@psaia
Copy link
Owner

psaia commented Feb 26, 2015

@cfxd, Based on the snippet you sent me (thank you, btw):

a:2:{i:2;a:3:{s:5:"title";s:7:"HIRE US";s:4:"text";s:34:"<a href="http://1234.dev">test</a>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}

I believe the issue is the way you're exporting the dump. Specifically, the problem is the nested quotations - "<a href="http://1234.dev">test</a>". Ideally, it should export to '<a href="http://1234.dev">test</a>'. This may actually be an issue with MySQL. Could you provde the version you are using? This issue isn't occurring for me using mysqldump Ver 10.13 Distrib 5.6.10, for osx10.8 (x86_64).

Run mysqldump --version to display the version.

Related:

@cfxd
Copy link
Author

cfxd commented Feb 26, 2015

mysqldump Ver 10.13 Distrib 5.5.29, for osx10.6 (i386)

Will investigate further and let you know what I find.

@cfxd
Copy link
Author

cfxd commented Feb 26, 2015

Just upgraded to mysqldump Ver 10.13 Distrib 5.6.23, for osx10.8 (x86_64) and I get the same result when migrating the db, even though the entry now appears completely escaped:

a:2:{i:2;a:3:{s:5:\"title\";s:7:\"HIRE US\";s:4:\"text\";s:34:\"<a href=\"http://ushs.dev\">test</a>\";s:6:\"filter\";b:0;}s:12:\"_multiwidget\";i:1;}

@psaia
Copy link
Owner

psaia commented Feb 26, 2015

I think it's odd that 100% of them are escaped. I'm going to work on a test for this today.

@cfxd
Copy link
Author

cfxd commented Feb 26, 2015

Ok, let me know if you need anything else from me to help.

psaia pushed a commit that referenced this issue Feb 27, 2015
@psaia
Copy link
Owner

psaia commented Feb 27, 2015

I've made an update to the core class. I was unable to re-create the problem exactly but I have a suspicion as to what's causing it. The beginning (s:123:"...) and end (";) was being hard-coded in the previous version assuming all sql dumps were created equal. In this latest commit i'm capturing and using whatever type of quotation (and/or escaping methodology) the dump is using. Hopefully this fixes the issue, but it's quite possible it doesn't. Please feel free to hack your local grunt-peach (tasks/migrate.js) to see if it fixed the issue. This weekend I'm going to fork grunt-peach and do some further testing and finally a pull request.

@cfxd
Copy link
Author

cfxd commented Feb 27, 2015

Dude awesome, will do and will let you know what I find!

@davidosomething
Copy link

@petesaia hey I updated grunt-peach to use your repo as a dependency and require your peach.js file now

@cfxd
Copy link
Author

cfxd commented Feb 27, 2015

Just tried the new grunt-peach and the widgets still do not make it over :-(

@cfxd
Copy link
Author

cfxd commented Mar 2, 2015

What's really puzzling is why post content with internal links makes it over but the widgets with internal links do not. Strange that one works but not the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants