Notice: Undefined offset: 0 in Drupal\focal_point\Plugin\Field\FieldWidget\FocalPointImageWidget::process() (line 44 of /modules/focal_point/src/Plugin/Field/FieldWidget/FocalPointImageWidget.php).
Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "fid" for route "focal_point.preview" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 193 of /core/lib/Drupal/Core/Routing/UrlGenerator.php).
Visiting a edit form page which would normally display a focal point widget causes a WSOD with the above fatals.
Uninstalling focal point and crop API, then re-installing did not resolve the issue.
Reverting focal point to beta1 resolved the issue.
Site running on D8 8.1.7.
The entity form being is a node with just a few core provided field types, nothing special.
Comment | File | Size | Author |
---|---|---|---|
#9 | focal_point_fatals_on-2784287-9.patch | 1.29 KB | bleen |
| |||
#7 | focal_point_fatals_on-2784287-7.patch | 1.46 KB | bleen |
|
Comments
Comment #2
bleen CreditAttribution: bleen at NBCUniversal commentedI have tried several times to reproduce this ... can you reproduce this on more than one site?
Comment #3
bleen CreditAttribution: bleen at NBCUniversal commentedThis might be the same issue as #2782749: Crop not working on beta2 which I havent been able to reproduce.
Is there any chance that this is an issue with local cache? If you copy the image path (of an image that should have changed but didnt) and open it in a new tab in your browser with ?cachebuster=fgdkjhdgjdkfshgdfskjghfdjkggdfs appended to the URL, does the image suddenly look correct? (If there is already a ?itok=sdgkjhsdgkh then use an "&" instead of a "?" for the cachebuster)
Comment #4
justkristin CreditAttribution: justkristin commentedWe are having this same error now when trying to edit a node that uses focal point for one of the images. If the problem is with crop, can we use focal point without it? It is less important than focal point itself...
Comment #5
justkristin CreditAttribution: justkristin commentedI was also able to make the fatal go away by backing up to beta1.
Comment #6
caldenjacobs CreditAttribution: caldenjacobs commentedSame issue here. Downgrading to Beta1 fixed on my end as well.
Comment #7
bleen CreditAttribution: bleen at NBCUniversal commentedThis patch will definitely fix the issue, but in those cases where the fid cannot be found the preview link will not appear.
Comment #8
bleen CreditAttribution: bleen at NBCUniversal commentedI *still* cant seem to find any way to reproduce this issue .. can everyone plaese try to give me as much detail as possible to any customizations you might be making to the form where you are seeing this error so I can try to figure this out. Are your fields limited to 1 image or multiple? do you every manipulate form_state in a custom module anywhere? any weird hook form alters? Does this happen EVERY time you load the form or only on Tuesdays? Does it happen only when creating a new entity? Only when updating? Both?
Ideally, someone who is seeing this error and is using an IDE, please set a breakpoint point in FocalPointImageWidget::process and put the values of $item, and $element in a gist so I can see them.
Just for the record, it's the preview functionality that is causing this, not the crop integration ...
Comment #9
bleen CreditAttribution: bleen at NBCUniversal commentedHmmm ... it looks like the issue *might* be that in some circumstance (I'm guessing based on another contrib module, or some config that I can't find anywhere) the upload widget that appears below any existing images has a "preview" in its element array for some reason.
Based on that, I think this is a safe solution. Please review....
Comment #10
dpiRe-downloaded beta2, applied patch, the widget appears to be working again.
Comment #12
bleen CreditAttribution: bleen at NBCUniversal commentedComment #13
Scott Falconer CreditAttribution: Scott Falconer commentedThis happens for me if I have a default image set for the field. Remove the default image and the issue doesn’t occur. Patch in #9 resolves the issue.
Comment #14
bleen CreditAttribution: bleen at NBCUniversal commentedAwesome.... Thanks for finally giving me a way to reproduce
Comment #15
dpiI double checked both sites I constructed recently with focal_point, and there are no image fields with default images. Take that as you will...
Comment #16
agentrickardYes, confirming that this happens if the field has a default image set. In my case:
* Create user profile "picture" field with default image
* Save new account (with default image)
* Try to edit account -- error occurs.
It may be that the original account was created prior to the "preview" functionality being added to the module. I did do an update to beta2 this week. So the field may have been created with beta1, where the preview link doesn't exist, so no problem was reported.
Comment #17
bleen CreditAttribution: bleen at NBCUniversal commentedchanging title in case people search for this later ...
also, I'm hoping to create a new release once I can get #2790809: Preview page return "Access Denied" when creating a new node settled ... hint, hint, nudge, nudge