Basically block_custom_block_save expects $body to be an array with keys 'value' and 'format', we pass it a string so we end up with just the first character of the previous block body.
Test to verify fail.
Then a fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, linkchecker.pass_.patch, failed testing.

hass’s picture

What link checker version are you using? Your patch looks not correct. Have you seen linkchecker_block_custom_block_get()?

larowlan’s picture

Priority: Major » Normal
Status: Needs work » Needs review
FileSize
2.44 KB

Yep, looks like the issue has been fixed in the dev branch, I had the 7.x-1.0-beta1, apologies.
Regardless the attached patch adds extra test coverage.

larowlan’s picture

Title: Link checker destroys block bodies when auto-update is configured for 301 redirects » Add extra tests for block checking and update features
Category: bug » task
hass’s picture

beta1 is very old and has some issues... This was fixed before 1.0 final. Please use latest version only.

Thanks for these tests!

hass’s picture

Status: Needs review » Needs work

I see some issues with this test. The main problem here is that the test rely on googles today behaivior. This is a real life test, but this is not reliable on the other side if something change at google. I'm strongly for faking the status code and manually do the tests.

The test here is a good starting point for #1917188: Write tests for status code handling and auto update.

hass’s picture

Aside, do we have a hook_block_update/insert/delete now in D8?

VladimirAus’s picture

Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)

Task was updated more than 9 years ago. 🏰
Marking as outdated.
Please update description and info if it is still valid.