On a vanilla D7 alpha 7 (or D7 snapshot) with the latest insert 7.x-1.x-dev snapshot, the create content page for any content type with the insert button enabled breaks, producing this warning:
Fatal error: Call to undefined function file_directory_path() in ...\sites\all\modules\insert\insert.module on line 209
Meanwhile, the edit page for any image field with the insert button enabled carries this error message:
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 167 of C:\wamp\www\includes\entity.inc).
(Pardon, please, if this is a core issue)
Comment | File | Size | Author |
---|---|---|---|
#11 | 918958_file_dir_path_api_fix.patch | 1.07 KB | tsvenson |
#6 | file_dir_path_api_fix.patch | 704 bytes | tsvenson |
Comments
Comment #1
mallory99 CreditAttribution: mallory99 commentedThought I'd better clarify - when I say edit page for the 'image' field, I mean in content types - manage fields.
Comment #2
quicksketchI've given up working on D7 modules until D7 stabilizes.
Comment #3
quicksketchIn the mean time, I've just removed the D7 version entirely from the project page. You can still download it by clicking "View all releases" from the project page.
Comment #4
florisla CreditAttribution: florisla commentedIs a new version of Insert module planned now that D7 is in beta?
Comment #5
tsvenson CreditAttribution: tsvenson commentedfile_directory_path() is removed from Drupal 7 due to all changes to the file management.
I simply change file_directory_path() to file_default_scheme() on line 209. Then tried it with Drupal 7 beta 2 and got no errors when using insert with the default image field to the article type.
Comment #6
tsvenson CreditAttribution: tsvenson commentedHm, the patch wasn't attached...
Comment #7
florisla CreditAttribution: florisla commentedThanks for the patch. On Drupal 7 beta2 the insert button still does not appear on image fields. I guess I need to dig a bit further.
Comment #8
tsvenson CreditAttribution: tsvenson commentedDid you enable Insert for the image field for the content type?
Comment #9
florisla CreditAttribution: florisla commentedI didn't realize that was necessary; thanks. It's working fine now.
Comment #10
florisla CreditAttribution: florisla commentedOf the two issues described above by the original poster, the
array_flip()
error is still present in 7.x-1.x-alpha3 on Drupal 7 beta 2.Comment #11
tsvenson CreditAttribution: tsvenson commentedI found another file_directory_path that created more fatal issues with insert. Have changed that too now and attached a new patch.
Regarding the flip_array problem, it is a different issue and also a dupe of #850946: Warning after enabling Insert: Warning: array_flip(): Can only flip STRING and INTEGER values!. Thus I have changed the title to only cover the fatal error my patch is fixing.
Comment #12
florisla CreditAttribution: florisla commentedI applied patch #11 as well. Seems to work for me. Is that enough to be able to close this issue?
Comment #13
tsvenson CreditAttribution: tsvenson commentedNo, I'm not the maintainer for this module. Issues with community contributed patches should only be set to fixed by the maintainer. Lets leave it like this until then.
Comment #14
mlncn CreditAttribution: mlncn commentedWe can, however, set it to "reviewed & tested by the community". ;-)
Also, module breaking entire site warrants critical– and tsvenson's patch fixes it for me also.
Comment #15
tsvenson CreditAttribution: tsvenson commented@florisla and @Benjamin Melançon
Glad to hear my patch worked for you. Haven't had any problems with Insert after that so at least it got it working with D7 again.
Comment #16
florisla CreditAttribution: florisla commented@tsvenson
Aren't you affected by #850946: Warning after enabling Insert: Warning: array_flip(): Can only flip STRING and INTEGER values! on D7?
That's the only thing bugging me right now; will be looking into it later this week.
@quicksketch: Any plans to apply the patch in #11 to CVS?
Comment #17
tsvenson CreditAttribution: tsvenson commented@florisla
Yes, I am affected with that as well (I actually was the one originally reporting it), which I believe everyone is. It is a bug, but you can sort of work around it. Not like this one that renders both Insert and the whole site broken.
Comment #18
okokokok CreditAttribution: okokokok commented#11 works for me too. And then I'm also bitten by #850946: Warning after enabling Insert: Warning: array_flip(): Can only flip STRING and INTEGER values!.
Comment #19
stuen93 CreditAttribution: stuen93 commentedDid you get file_directory_path on line 28 of insert.module?
Comment #20
stuen93 CreditAttribution: stuen93 commentedmeaning that it needs to be changed there to I believe.
Comment #21
tsvenson CreditAttribution: tsvenson commented@stuen93, yes. See patch in #11
Comment #22
JohnnyX CreditAttribution: JohnnyX commentedPatch #11 seems to work for me...
Will insert go on and become a release for Drupal 7?
*UPDATE*
Seems a little buggy with colorbox (and image_resize_filter) but I will give it a second try with a new installed page...
I'm searching for a upload and insert module for Drupal 7 and this module looks good. Maybe I will test also imagepicker and dragndrop_uploads again...
Comment #23
quicksketchThanks, committed. Let's create new issues for any further changes.