Problem/Motivation

I assume based on the comment this was something seen in the wild. However my links are not double serialized so I'm getting a bunch of these:

unserialize() expects parameter 1 to be string, array given CckLink.php:49

This is probably a bug somewhere in CCK which isn't really worth fixing since we can support both cases.

Proposed resolution

unserialize, check for array and unserialize again if its still a string.

Remaining tasks

Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

neclimdul created an issue. See original summary.

neclimdul’s picture

Status: Active » Needs review

test it bot.

phenaproxima’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

The committers probably won't accept this without a test.

neclimdul’s picture

Status: Needs work » Needs review
StatusFileSize
new4.56 KB
new3.61 KB

What about this? I didn't think ahead to setup making the interdiff but the test data is the only thing so the failure patch is basically an interdiff. Sorry.

Hopefully the double unserialize will throw the error and kill the test as expected.

Status: Needs review » Needs work

The last submitted patch, 4: ccklinks_double-FAILURE-2588421-4.patch, failed testing.

neclimdul’s picture

Status: Needs work » Needs review

Awesome! Me getting the order of the patches wrong aside, that was as expected!

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Great. So the tests already catch this, but we didn't have any test data in our fixtures which would expose the problem.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: ccklinks_double-FAILURE-2588421-4.patch, failed testing.

The last submitted patch, 4: ccklinks_double-FAILURE-2588421-4.patch, failed testing.

neclimdul’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new4.56 KB

gugh... ok that didn't happen with pifr. reposting to work around the wonkyness.

  • webchick committed abbeb3c on 8.0.x
    Issue #2588421 by neclimdul: CckLinks double unserialized attributes...
webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +rc eligible

I looked for more information on why that double-escaping might happen, and traced it back to the initial commit: #2233883: Link migration needs to convert source url into the appropriate route format for storage Something in benjy's test data. Adam says he's seen it before too. So I was going to mark it needs work for a better explanation, but the explanation appears to be "gremlins" so... ;)

Since these changes are self-contained against an experimental module, I believe that makes this eligible for commit during RC. Tagging.

Committed and pushed to 8.0.x. Thanks!

neclimdul’s picture

I really shouldn't gush
Webchick fixes things in a rush
Gremlins begone
She is too strong
She beats them with a git push.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

thlor’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new40.96 KB
new1.67 KB

We are migrating a D6 site where we found that some attribute arrays are not only double serialized - one of them up to 19 times.
s:155:"s:146:"s:137:"s:128:"s:119:"s:110:"s:101:"s:93:"s:85:"s:77:"s:69:"s:61:"s:53:"s:45:"s:37:"s:29:"s:21:"s:13:"s:6:"a:0:{}";";";";";";";";";";";";";";";";";";";
Multiple serialization example

Now I didn't spend time to understand what causes this bug in Drupal 6, but I assume that whatever it is, it is related to whatever caused the bug reported originally in this issue. If you can advise how I could understand whether this is caused by a D6 core bug (making it necessary to tackle it in D8 migration), or caused by custom code in our D6 site, without having to spend too much time debugging EOL D6 code or sharing our D6 code base, please let me know :)

As a workaround, I refactored the last patch into a recursive function.

thlor’s picture

Version: 8.0.x-dev » 8.3.x-dev

Status: Needs review » Needs work

The last submitted patch, 15: ccklinks_multiple-2588421-5.patch, failed testing.

anish.a’s picture

Is this issue still needs work?

thlor’s picture

@anish.a yes. In the context of my project I solved it with the patch I submitted, but it would need to be implemented.

  • webchick committed abbeb3c on 8.4.x
    Issue #2588421 by neclimdul: CckLinks double unserialized attributes...

  • webchick committed abbeb3c on 8.4.x
    Issue #2588421 by neclimdul: CckLinks double unserialized attributes...

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mikeryan’s picture

Status: Needs work » Fixed

@thlor The original issue here was committed to core a long time ago - a new issue should be opened to address any remaining issues in this area.

mikeryan’s picture

Version: 8.4.x-dev » 8.0.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.