I encountered the following error when attempting a retroactive update after changing a file field from public to private, using the procedure described here.

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=79021&op=do StatusText: OK ResponseText: Parse error: syntax error, unexpected 's' (T_STRING) in .../modules/contrib/filefield_paths/filefield_paths.module(448) : runtime-created function on line 1 {"status":true,"percentage":"5","message":"Completed 0 of 1.\u003Cbr \/\u003E"}

Also similar errors on subsequent runs, with the syntax error varying slightly, e.g.

syntax error, unexpected 'o' (T_STRING)
syntax error, unexpected 'not' (T_STRING)
syntax error, unexpected 'Their' (T_STRING)

By adding some debugging code, I tracked the problem down to filenames containing single quotes (ASCII 39). I came up with a fix that seems to have resolved the problem. I later found that the 2016-01-04 7.x-1.0+1-dev version has a change to relevant code - adding a test for if (!$callback) - however I had already tried this approach and it wasn't successful, as the error occurred at the line above, though it avoided a subsequent error when trying to apply the empty callback.

Shall I submit a patch or should one be avoiding this scenario by using the File name options?

Thanks for all your work on this very useful module. - Dave

Comments

davej created an issue. See original summary.

oadaeh’s picture

Status: Active » Closed (duplicate)

I'm marking this as a duplicate of [#2849276]. Even though this one is older, that one has a patch already.