When IMCE is installed, there is usually a checkbox that allows you to enable it on a per-field basis.

If focal point is selected as the widget, this selection is no longer available, removing the ability to use the IMCE browser to select an image from the library.

I'm adding this post to this issue queue as feel it's more relevant here, as the IMCE addition adds to the normal image field widget, so could be respected here.

Comments

kiwimind created an issue. See original summary.

bleen’s picture

If IMCE is adding this option to the normal image widget then they are making an assumption about the widget being used. Any module that provides an alternate widget for image fields (including focal point) will have this issue. I'm not convinced that this should be fixed in focal point (as opposed to the IMCE module supporting additional widgets)...

I'm happy to have the discussion though... :)

kiwimind’s picture

Ok, fair point.

Would you like me to raise this on the IMCE module page, or move it to their queue?

Thanks for the quick response.

bleen’s picture

I would ...

kiwimind’s picture

Title: Unable to use with IMCE » Unable to use with focal point
Project: Focal Point » IMCE
Version: 8.x-1.x-dev » 8.x-1.6
Component: Media Integration » Code

Ok, thanks, moving to IMCE queue...

kiwimind’s picture

StatusFileSize
new555 bytes

I've now added the image_focal_point widget to the accepted widgets, which seems to work. Happy to accept other ideas.

Patch attached.

ufku’s picture

Title: Unable to use with focal point » Add IMCE support
Project: IMCE » Focal Point
Version: 8.x-1.6 » 8.x-1.x-dev
Component: Code » Image Presets
Category: Bug report » Feature request

You can add IMCE support for your widget by using hook_imce_supported_widgets_alter()

function hook_imce_supported_widgets_alter(&$widgets) {
  $widgets[] = 'image_focal_point';
}
kiwimind’s picture

Status: Active » Closed (works as designed)

Ok, thanks @ufku. Will do that.

Wasn't aware of that hook.

bleen’s picture

Status: Closed (works as designed) » Active

@kiwimind ... sounds like a new feature request to me. If you want to make a patch, I'd review

kiwimind’s picture

Status: Active » Needs review
StatusFileSize
new489 bytes

Ok, thanks. By way of a starter, how does this sit?

I'm unsure as to whether or not I need to test the existence of IMCE first and how to go about that...

bleen’s picture

I haven't actually tested #10 but I can say that you do not need to test the existence of the IMCE module since the hook is called by that module.

Can you please post the steps you are taking to test the patch...

kiwimind’s picture

StatusFileSize
new38.47 KB
new26.54 KB
new40.3 KB
new29.56 KB

Prior to applying the patch you'll notice the lack of "Imce enabled" as an option as well as the missing "Open file browser" when the Image - focal point widget is selected on the teaser image.

After applying the patch, they're both visible and working as expected.

I've got another slight issue where the focal point appears to be stored against the image, rather than its usage (so all instances of an image on a page e.g. a listing page using teaser images are all affected when you alter one of the focal points), but will see if that's going to affect me much and will raise as a separate issue as necessary.

bleen’s picture

Status: Needs review » Fixed

Looks great! Thanks!

kiwimind’s picture

No worries, thanks for the review (and the module!).

  • bleen committed bc171e3 on 8.x-1.x authored by kiwimind
    Issue #2920265 by kiwimind: Add IMCE support
    

Status: Fixed » Closed (fixed)

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