Hello, I have already applied a patch #76

and when I want to start to repair, it gives me this error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=118&op=do_nojs&op=do
StatusText: OK
ResponseText: TypeError: Argument 1 passed to image_field_repair_process_table_range() must be of the type array, null given, called in /home/xxxxxxxx/modules/contrib/image_field_repair/image_field_repair.inc on line 57 in image_field_repair_process_table_range() (line 133 of /home/xxxxx/modules/contrib/image_field_repair/image_field_repair.inc).
CommentFileSizeAuthor
#3 2931750-3.patch2.26 KBAnonymous (not verified)
#3 2931750-3-test-only.patch1.82 KBAnonymous (not verified)

Comments

mpark created an issue. See original summary.

fietserwin’s picture

I am sorry but fail to se how this error could occur. Can you indicate:

- the number of image fields your site has.
- whether they are versioned.
- what type of storage is used for these fields.
- the number of records per image field table.
- is there any warning (that precedes this error message) in the watchdog or php log?

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.82 KB
new2.26 KB

This happens when there are holes in the $tables array after the filter(). A simple solution is just reindexing array.

The proof test shows the process when the middle table (node_image2_empty) is empty.

  • fietserwin committed 95fdf6c on 8.x-1.x authored by vaplas
    [#2931750] by vaplas: TypeError: Argument 1 passed to...
fietserwin’s picture

Title: error when start the process » Error: TypeError: Argument 1 passed to image_field_repair_process_table_range() must be of the type array, null given
Status: Needs review » Fixed

I thought array_filter() returns a new array without keeping keys, so now I understand how this error might occur. Thanks for reporting and providing a patch and a test. Though it is a basic test, it is a start.

Fixed and committed.

Status: Fixed » Closed (fixed)

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