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.

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
StatusFileSize
new2.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.

quadrexdev’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Everyone can apply the patch above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.