Hello,
with the latest stable version I get this error:
Notice: Undefined index: und in _imagefield_crop_entity_presave() (line 420 of /.../sites/all/modules/imagefield_crop/imagefield_crop.module).
Warning: Invalid argument supplied for foreach() in _imagefield_crop_entity_presave() (line 420 of /.../sites/all/modules/imagefield_crop/imagefield_crop.module).
With the last version which have two patches everything works. I have attached my working version..maybe it helps.
Best regards
Frank
| Comment | File | Size | Author |
|---|---|---|---|
| #52 | imagefield_crop-undefined_index_und-1913412-52.patch | 1.11 KB | batigolix |
| #45 | imagefield_crop_use_empty_instead_of_isset-1913412-45.patch | 430 bytes | PawelR |
| #43 | undefined_lang_empty_field-1913412-43.patch | 1.15 KB | lex0r |
| #38 | imagefield_crop-clean_up_presave-1913412-38.patch | 973 bytes | Robert_W |
| #33 | pic1.png | 73.44 KB | fraweg |
Comments
Comment #1
fraweg commentedNo ideas in that? :-(
Comment #2
joetsuihk commented#1469216: Imagefield Crop does not respect the "help text" witch is set in the config area. is a separate issue.
Can you tell where 0001-Fixing-field-instance-issue.patch comes from?
I cannot separate this problem with particular code that fix it.
Comment #3
fraweg commentedHello joetsuihk,
thanks for your post!
What does you mean with this? Did you mean this is the same issue?
Yes, it is a patch for the profile2 compatibilty. I found it here:
http://drupal.org/node/1358474
I hope this helpes...
Best regards
Frank
Comment #4
fraweg commentedHello,
am I allone with this issue?
Best regards
Frank
Comment #5
mkmagu commentedNo, I'm getting the same error when uploading a photo.
Notice: Undefined index: und in _imagefield_crop_entity_presave() (line 420 of /home/..../public_html/gsrcny/sites/all/modules/imagefield_crop/imagefield_crop.module).
Warning: Invalid argument supplied for foreach() in _imagefield_crop_entity_presave() (line 420 of /home/.../public_html/gsrcny/sites/all/modules/imagefield_crop/imagefield_crop.module).
Comment #6
Sean-Khan commentedI'm getting this error when creating a node with crop image field with rules.
Comment #7
joetsuihk commentedre #3, #1358474: Fatal errors: Undefined Index when imagefield_crop field is included in a profile2 entity had committed and included in 7.x-1.1
As you had a working solution, can you download the latest 1.1 and make minimal changes to the code to make it works? So others having the same issue can also test your module.
Sorry for this late reply.
Joe
Comment #8
fraweg commentedHello joetsuihk,
maybe we misunderstood each other. The attached zip includes the 7.x.1.0 version with the included patches. And this version runs. I did not change code in that. With the new version I had this new issue.
Best regards
Frank
Comment #9
jweowu commentedfraweg: you really need to provide a patch, not a modified copy of the entire module. Patches are far more useful. Just follow the instructions if you're not familiar with making them: http://drupal.org/node/209591/git-instructions/7.x-1.x
In any case, I've encountered the same issue, which was occurring on a node with an empty image field.
Potentially the correct fix is to change this:
into:
But as I wasn't 100% certain that it would be sufficient in all circumstances, I've gone with the attached patch.
Comment #10
joetsuihk commentedThanks! @jweowu
http://drupalcode.org/project/imagefield_crop.git/commit/e5c1c97
Comment #11
jweowu commentedYou're welcome, and cheers for the quick commit (I believe that link should have been http://drupalcode.org/project/imagefield_crop.git/commit/48fb2fd :)
Comment #13
fraweg commentedHello,
for me this issue still exists with the actual dev version. When I save the profile with a croped field I get this error:
Any Ideas..
Best regards
Frank
Comment #14
joetsuihk commentedOk, imagefield crop on user profile. Please try the patch
Joe
Comment #15
jweowu commentedjoetsuihk: actually, the patch I supplied in #9 was correct, but a different change was committed :/
If you revert http://drupalcode.org/project/imagefield_crop.git/commit/48fb2fd and apply the patch from #9, that should do the trick.
Comment #16
fraweg commentedHello,
thanks for your support!
@joetsuihk with your patch from #14 I get this error:
@jweowu with your committed version from #15 I get this error:
Best regards
Frank
Comment #17
joetsuihk commentedRe #16, how is it possible to have language translation of a field? Can you list the modules you enabled related to languages?
You get the error when saving a image field attached to user entity?
Comment #18
fraweg commentedHello joetsuihk,
sorry for the long time to ask you. I am really busy the last days. I make some screenshot. There you can see my modules.
Yes.
Many thanks for your support!
Best regards
Frank
Comment #19
jweowu commentedAs per comment #15, the following should resolve this (or at the very least, get things back into a state where people are testing the intended patch).
git reset --hard
git revert --no-commit 48fb2fd0eda309e98b3fc51b020abde064568855
git reset HEAD imagefield_crop.module
git apply imagefield_crop-undefined_index_und-1913412-9.patch
Comment #20
fraweg commentedHello jweowu,
tanks for your post!
But I do not understand what to do. I am not a real developer. So what does (for example) "git reset --hard" mean and how can I do this?
Best regards
Frank
Comment #21
jweowu commentedfraweg: If you check out the git repository for the module, as per the instructions here: http://drupal.org/node/209591/git-instructions/7.x-1.x
git clone --branch 7.x-1.x http://git.drupal.org/project/imagefield_crop.git
cd imagefield_crop
git pull origin 7.x-1.x
(which you probably did already to test the existing patches?)
You can then issue the commands I listed to end up with the correctly patched version of the module.
Git is complex, so I don't wish to get into the details (there is plenty of documentation online if you're keen to learn). If you're unsure, just ignore this entirely; I assume joetsuihk will sort it out sometime in the near future.
Comment #22
joetsuihk commentedI do not think we need to revert http://drupalcode.org/project/imagefield_crop.git/commit/48fb2fd?
i mean, apply #9 or #14? #9 and #14? I will test them tomorrow.
Comment #23
jweowu commentedjoetsuihk: please compare the patch in #9 and the code that was actually committed, and you will see why the problem exists: the additional code from the patch was moved from where it was supposed to be, to an earlier position in the function, which changes the logic entirely.
You can either revert that commit and apply #9, or simply fix the existing code so that it matches. I'm just trying to provide a reliable way forward.
#14 isn't necessary at all. That error only arose because of the mis-positioned code, as the module is now trying to use the lang variable before it's been defined.
Comment #24
joetsuihk commentedHope this time really fix this issue.
http://drupalcode.org/project/imagefield_crop.git/commit/70162b5
Comment #25
jweowu commentedI really don't understand why you've still applied the patch from #14, rather than deleting those lines of code completely? That code just looks wrong, and surely introduces a bug if not all fields use the same language key?
This is why I suggested reverting the original commit and applying the correct patch.
Comment #26
goldUmm... Looking at the diff that was mentioned in #11 it doesn't appear to be the patch from #9. There's a lot of whitespace edits and the actual code is in the wrong place for it to be from that patch.
joetsuihk, did you add the update by hand or use patch.
The patch as it stands also introduces another bug which the patch at #14 appears to be trying to fix.
I'd go with the suggestion from jweowu in #19. Roll back and apply the initial patch at #9 leaving #14 out for now.
I also noticed that between #9 and #10 the status went from needs review to fixed withough first going through reviewed and tested by the community. This sort of thing would likely not have occured if the usual community based peer-review process was followed. Just saying... ;)
Comment #27
fraweg commentedHello,
the last dev-version seems to work for me...Great suport..Thanks so much!
Best regards
Frank
Comment #28
joetsuihk commentedre #26, yes, sorry that I committed some code not yet reviewed. That was a mistake, sorry about that.
About the white space, Drupal coding standard suggest whitespace should be removed, and that is also my config on my sublimetext, that is why whitespace is removed.
A closer look to lines around 417, I suggest remove the few lines altogether, as that check is actually repeated, patch attached.
Comment #29
jweowu commentedGood. You'll also want to split that
} elseifa few lines below over two lines (again, as per coding standards), but logic-wise this brings us back to #9, so setting the status accordingly.Comment #30
jweowu commentedfraweg: could you please confirm that everything works correctly for you with the patch in #28? (At the moment you're the only other tester.) Thanks!
Comment #31
fraweg commentedHello,
of course I can do that. You mean to patch the latest dev with #28 ?
Best regards
Frank
Comment #32
jweowu commentedExactly right, thanks.
Comment #33
fraweg commentedHello,
I have test the software with the patch #28. The software seems to work with this patch. But there are two massages when the pictures are uploaded as you can see it in "pic1" . I think this is to much information.
One other issue (maybe this should be in a seperate thread) that the pictures have no preview after safe if the picture is placed in the private file system as you can see it in the "pic2"
Thanks a lot for your work in this very usefull module!
Best regards
Frank
Comment #34
jweowu commentedThanks fraweg. Neither of those are related to this issue, so you should log a new issue for each of them (if none already exist).
joetsuihk, I'd call this RTBC if you'll fix up the formatting issue that I mentioned in #29.
Comment #35
Robert_W commentedSorry to kick this issue, but is this ever going to be committed? I have the same error on some sites of mine and would like to get this fixed :).
Comment #36
joetsuihk commentedre #35, please work on #28 patch to follow coding standards as per #34 discussed before we can commit it.
Comment #37
joetsuihk commentedComment #38
Robert_W commentedI tried to make a new patch with the change proposed in #29, but beware: I have never ever done this (making a patch) and never used Git before, but I wanted to learn it (for everything there is a first time, right?).
So I don't know if I did everything correctly, but I (partly) followed the instructions in https://drupal.org/node/707484. I skipped steps 7, 8 and 9 because I didn't want to commit crap or break something.
I hope I did everything as should and that it can be committed now :).
Comment #39
joetsuihk commentedThanks @Robert_W, this looks good to me, any other reviewers' comment?
Comment #40
jweowu commentedA diff of the current module file with this patch applied, against the old revision with #9 applied (plus subsequent unrelated commits), confirms that they are the same.
Marking RTBC.
Comment #41
joetsuihk commentedCommitted, thanks everyone.
http://drupalcode.org/project/imagefield_crop.git/blobdiff/bda65cab912f8...
Comment #43
lex0r commentedThere is one more check we have to do when processing imagecrop fields - if anything is actually stored in the field, which is sometimes not the case. I made a patch against 7.x-1.1.
Comment #44
lex0r commentedComment #45
PawelR commentedI'm using dev version with committed #41 but I'm still getting this error, for some reason field_name is set but it's an empty string.
Using empty() instead of !isset() fixes this problem.
Comment #46
slydevil commented#45 solved this for me. I ran into this issue when trying to migrate a Drupal 6 content type into a Drupal 7 content type using the migrate module. Thanks!
Comment #47
lisotton commented#45 solved to me too.
I applied to 7.x-1.1 version.
Marking RTBC.
Comment #49
joetsuihk commentedJust commited! http://cgit.drupalcode.org/imagefield_crop/commit/?id=f487385
Thanks everyone!
But I think there maybe still another problem mentioned by @lex0r #43. Please reopen if so
Comment #50
jweowu commentedI believe #43 is redundant. It looks like an alternative approach to the fix which was already committed (i.e. equivalent to #9).
Comment #52
batigolixFor reasons I dont understand I got similar errors from this module and I needed an additional condition in this part of the code.