Working but on using bulk taxomonize getting this error An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /d7/batch?id=21&op=do StatusText: OK ResponseText: Fatal error: Class name must be a valid object or a string in /Applications/XAMPP/xamppfiles/htdocs/d7/includes/common.inc on line 7506
When I attempt to apply the patch, I get this response which is a fail:
patching file location_taxonomize.module
Hunk #1 succeeded at 153 (offset 9 lines).
Hunk #2 succeeded at 162 (offset 9 lines).
Hunk #3 succeeded at 382 (offset 11 lines).
Hunk #4 succeeded at 394 (offset 11 lines).
Hunk #5 FAILED at 408.
1 out of 5 hunks FAILED -- saving rejects to file location_taxonomize.module.rej
can't find file to patch at input line 70
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/location_taxonomize_af/location_taxonomize_af.module b/location_taxonomize_af/location_taxonomize_af.module
|index 2f20f71..53e76ea 100644
|--- a/location_taxonomize_af/location_taxonomize_af.module
|+++ b/location_taxonomize_af/location_taxonomize_af.module
--------------------------
File to patch:
Maybe I'm missing something but I generally don't have many problems with patches unless they're out-of-date with the current module file set. Any ideas on how to remedy this? Removing the a's and b's?
Typing in "location_taxonomize_af/location_taxonomize_af.module" worked to complete the process but I'm still unsure of the practice of adding in what seems to be local development locations and not what is actually in downloads on the module page.
The patch is against an older version of the module, so the line numbers are no longer accurate. You can modify by hand (which is what I tend to do). Mostly, the patch finds and replaces "node" with "entity" and "nid" with "eid".
Since this is getting renewed attention, we should probably roll a new patch anyway and address issues raised in #3. I'm sure it won't get merged (and shouldn't) until at least that much is done.
Notice: Undefined index: field_location in location_taxonomize_af_element_submitted() (line 106 of /location_taxonomize/location_taxonomize_af/location_taxonomize_af.module).
Warning: Invalid argument supplied for foreach() in location_taxonomize_af_element_submitted() (line 108 of /location_taxonomize/location_taxonomize_af/location_taxonomize_af.module).
If I don't follow the suggestion in #13.
Bulk update doesn't work.
And if I change the city in the address field on my profile2 form, it doesn't update the field_location_taxonomize_terms field, so I'm not sure the patch is working. Nodes still work as expected with the patch.
Well, I fixed my problem and am now getting the message - "Location Taxonomize could not attach the terms to the entity because the Taxonomy Reference field is not set up correctly."
How did I solve my problem? Well, in locational_taxonomize_af.module there is a line that says "$deltas = $form_state['values'][$field][$lang];," which works fine for nodes because the $form_state['values'] has the field names. Profile 2 Entities, however, don't. (Not sure about the rest as all I want this to do is work for Nodes and Profile2 Entities) Field names in Profile2 Entities are stored under the first key in $form_state['values'] and are the machine name of the profile. So in line 104 of a #10 patched location_taxonmize_af.module I grabbed the array_keys of $form_state['values']:
Ok. Here's my patch. It combines #10 with the other modifications I made to get entities working. Bulk operations is still broken though, if someone wants to tackle that part of the problem.
Here's what I got when trying to apply #17 to the latest dev version:
patch < supportotherentities.patch
(Stripping trailing CRs from patch.)
patching file location_taxonomize.inc
(Stripping trailing CRs from patch.)
patching file location_taxonomize.module
Hunk #1 succeeded at 150 (offset -6 lines).
Hunk #2 FAILED at 411.
1 out of 2 hunks FAILED -- saving rejects to file location_taxonomize.module.rej
(Stripping trailing CRs from patch.)
can't find file to patch at input line 129
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- \location_taxonomize_af\location_taxonomize_af.module 2012-06-03 22:30:00.000000000 -0800
|+++ \location_taxonomize_af\location_taxonomize_af.module 2013-11-16 17:41:05.000000000 -0800
--------------------------
File to patch:
Here is my attempt at making it fully entity aware.
The previous patches were only making changes for profile2, which isn't a true entity implementation.
I did try to take how profile2 set up its forms to process that data as well.
My testing was done with the address field module. I did not have any install that used the location module, but it looks pretty entity ready, but might not work with profile 2.
Some bigger changes came with how the bulk updating works, to keep track of entity_ids and entity_types.
I am using an address field on core user profiles and am still encountering some problems with the association of terms with the users:
I have applied your patch to the latest dev version and checked the 'Taxonomize locations from this field' in the address field. After a bulk update the locations are entered into the location vobaulary fine as terms. However, the terms are not linked to the corresponding user profiles. I still get the "There is currently no content classified with this term" message when i click one of the entered terms.
Am I doing something wrong, or does the patch not cover user profiles (yet)?
There is one additional problem with the entity support of this module.
Currently this acts on the form_submit hook, and if the module is created with some importing tool like feeds this could cause it not to work anymore.
I think it would be much better to rewrite and to act on entity_presave.
Comments
Comment #1
webankit commentedWorking but on using bulk taxomonize getting this error
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /d7/batch?id=21&op=do StatusText: OK ResponseText: Fatal error: Class name must be a valid object or a string in /Applications/XAMPP/xamppfiles/htdocs/d7/includes/common.inc on line 7506Comment #2
goron commentedComment #3
webflo commentedI done a visual review. Never applied it.
entity_load($eid) will fail. First parameter is entity_type.
location_taxonomize has no dependency entity api.
Should be an entity field query.
entity_type is missing.
this should be dynamic
Comment #4
goron commentedComment #5
stevenx commented#1 works OK for user entity with adressfield
Comment #6
deanflory commentedWhen I attempt to apply the patch, I get this response which is a fail:
patching file location_taxonomize.module
Hunk #1 succeeded at 153 (offset 9 lines).
Hunk #2 succeeded at 162 (offset 9 lines).
Hunk #3 succeeded at 382 (offset 11 lines).
Hunk #4 succeeded at 394 (offset 11 lines).
Hunk #5 FAILED at 408.
1 out of 5 hunks FAILED -- saving rejects to file location_taxonomize.module.rej
can't find file to patch at input line 70
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/location_taxonomize_af/location_taxonomize_af.module b/location_taxonomize_af/location_taxonomize_af.module
|index 2f20f71..53e76ea 100644
|--- a/location_taxonomize_af/location_taxonomize_af.module
|+++ b/location_taxonomize_af/location_taxonomize_af.module
--------------------------
File to patch:
Maybe I'm missing something but I generally don't have many problems with patches unless they're out-of-date with the current module file set. Any ideas on how to remedy this? Removing the a's and b's?
Comment #7
deanflory commentedTyping in "location_taxonomize_af/location_taxonomize_af.module" worked to complete the process but I'm still unsure of the practice of adding in what seems to be local development locations and not what is actually in downloads on the module page.
Comment #8
mbrakken commentedThe patch is against an older version of the module, so the line numbers are no longer accurate. You can modify by hand (which is what I tend to do). Mostly, the patch finds and replaces "node" with "entity" and "nid" with "eid".
Since this is getting renewed attention, we should probably roll a new patch anyway and address issues raised in #3. I'm sure it won't get merged (and shouldn't) until at least that much is done.
Comment #9
johnvMarked #1541310: Get Location Taxonomize to work all entities, not just nodes as a duplicate.
Comment #10
sanchiz commentedNew patch version , works with 2.4 module
Comment #11
johnv@sanchiz, are you sure this is working? The comments in #3 are not addressed.
Especially
entity_load($eid) will fail. First parameter is entity_type.Comment #12
sanchiz commented@johnv Indeed, bulk operation does not work properly, I'll correct it. Thank you!
Comment #13
sanchiz commentedPatch # 10 is not quite correct, that would earn the addition of the term when submitting the form, you need to comment out this line:
If this does not work bulk operation.
Comment #14
stevenx commentedHow could we get it working with bulk operation?
I am note sure where to start to fix this issue
Comment #15
lonehorseend commented#10 gives me these errors:
If I don't follow the suggestion in #13.
Bulk update doesn't work.
And if I change the city in the address field on my profile2 form, it doesn't update the field_location_taxonomize_terms field, so I'm not sure the patch is working. Nodes still work as expected with the patch.
Comment #16
lonehorseend commentedWell, I fixed my problem and am now getting the message - "Location Taxonomize could not attach the terms to the entity because the Taxonomy Reference field is not set up correctly."
How did I solve my problem? Well, in locational_taxonomize_af.module there is a line that says "$deltas = $form_state['values'][$field][$lang];," which works fine for nodes because the $form_state['values'] has the field names. Profile 2 Entities, however, don't. (Not sure about the rest as all I want this to do is work for Nodes and Profile2 Entities) Field names in Profile2 Entities are stored under the first key in $form_state['values'] and are the machine name of the profile. So in line 104 of a #10 patched location_taxonmize_af.module I grabbed the array_keys of $form_state['values']:
And then I changed the $deltas line below that to an if then else check:
Once I get my new error figured out. I will roll a patch for the location_taxonomize_af.module
Comment #17
lonehorseend commentedOk. Here's my patch. It combines #10 with the other modifications I made to get entities working. Bulk operations is still broken though, if someone wants to tackle that part of the problem.
Comment #18
deanflory commentedHere's what I got when trying to apply #17 to the latest dev version:
patch < supportotherentities.patch
(Stripping trailing CRs from patch.)
patching file location_taxonomize.inc
(Stripping trailing CRs from patch.)
patching file location_taxonomize.module
Hunk #1 succeeded at 150 (offset -6 lines).
Hunk #2 FAILED at 411.
1 out of 2 hunks FAILED -- saving rejects to file location_taxonomize.module.rej
(Stripping trailing CRs from patch.)
can't find file to patch at input line 129
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- \location_taxonomize_af\location_taxonomize_af.module 2012-06-03 22:30:00.000000000 -0800
|+++ \location_taxonomize_af\location_taxonomize_af.module 2013-11-16 17:41:05.000000000 -0800
--------------------------
File to patch:
Comment #19
caw67 commentedCant apply the patch #17
Comment #20
caw67 commentedok, patch #17 dont work for me!
Comment #21
sk2013 commentedAny updates please?
Comment #22
Anonymous (not verified) commentedHere is my attempt at making it fully entity aware.
The previous patches were only making changes for profile2, which isn't a true entity implementation.
I did try to take how profile2 set up its forms to process that data as well.
My testing was done with the address field module. I did not have any install that used the location module, but it looks pretty entity ready, but might not work with profile 2.
Some bigger changes came with how the bulk updating works, to keep track of entity_ids and entity_types.
Hope this helps.
Comment #23
sk2013 commentedThanks for the Work "rsmylski". Much appreciated
Comment #24
Anonymous (not verified) commentedWas noticing some issues with bulk update. Updated my patch to resolve those.
Comment #25
Golem07 commented@rsmylski
Thanks for your work!
I am using an address field on core user profiles and am still encountering some problems with the association of terms with the users:
I have applied your patch to the latest dev version and checked the 'Taxonomize locations from this field' in the address field. After a bulk update the locations are entered into the location vobaulary fine as terms. However, the terms are not linked to the corresponding user profiles. I still get the "There is currently no content classified with this term" message when i click one of the entered terms.
Am I doing something wrong, or does the patch not cover user profiles (yet)?
Thanks in advance for your help!
Comment #26
k_zoltan commentedThe patch of @rsmylski works for me with some minor corrections, so here is my version of that patch.
The problem is that some coding standards were not followed by the initial module and this is why the patch is that fuzzy.
Comment #27
k_zoltan commentedThere is one additional problem with the entity support of this module.
Currently this acts on the form_submit hook, and if the module is created with some importing tool like feeds this could cause it not to work anymore.
I think it would be much better to rewrite and to act on entity_presave.
Comment #28
capfive commentedTested and working with Profile2!!! thank you so much! helps for directory listings
Comment #29
attisanRe-rolling patch as 26 did not apply cleanly for me.
Comment #30
milesw commentedPatch #29 works great with CRM Core contact entities. Thanks for the patch.
Comment #31
furamag commentedPatch #29 works fine with users.
Comment #32
danzVP06 commentedI tried Patch #29, It does not work with field collection.
Comment #33
kopeboyCan we still get the users' support in and then think about field collection?