Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Full message:
Undefined property: stdClass::$multiple in similarterms_block_info() line 65 of sites/all/modules/similarterms/similarterms.module
Had to disable similarterm module to have something stable.
Module Similar By Terms 7.x-1.0-alpha2
Comment | File | Size | Author |
---|---|---|---|
#9 | similaterms_1045378_9.patch | 7.88 KB | Sutharsan |
#2 | similarterms.d7.patch | 5.19 KB | inolen |
Comments
Comment #1
BerdirThen report it there, not for Drupal core :)
Comment #2
inolen CreditAttribution: inolen commentedThe D7 build was completely broken for me. This is my first Drupal patch, so let's hope it works. Added some misc. changes to make this work with D7's theming changes, also updated the database queries to work with D7's new schema, the old code referenced the table "term_node" and my new code references "field_data_field_tags" which appears to be proper. I also removed one of the query conditions (node.moderate = 0) because the column no longer existed, I'm not sure if a new condition should be added to replace it. This got me up and running, hopefully it's helpful.
Is this the proper way to post this patch? And is it now up to the maintainers to review and possibly commit it, or is there something more obvious that I am missing?
Comment #3
BerdirYes, what you are doing is correct. Not the maintainer, but I can give your patch a short review....
First, always set issues to needs review when you upload a patch. For projects that have automated testing enabled (this one doesn't), it will automatically get test and even when not, users can see that there is a patch which can be tested.
The rather new rule is to only add files to this definition that contain classes. Typically, these are for texample .test files.
Looks like you used a -dev download to port it. You should remove this part from the info file because it' automatically added by the bild script.
You should use 2 spaces instead of tabs.
What you did works, but it should be possible to do it with fewer lines.
Untested:
- fields and condition are chainable, add* and join calls not (This is a mess a know, one of the things I want to change in D8)
- I think you want to use the 'taxonomy_term_node (or similar) table to join, the field table is just for the default tags field and might or might not exist.
This can be written in two lines :)
ok, a few more lines, you want to add a check if there were any nid's returned.
Also, it looks like the query selects and groups by n.title but it doesn't seem to be used, so that could maybe be removed.
diff doesn't like it when there is no empty newline at the end of file, so you should leave that.
Powered by Dreditor.
Comment #4
inolen CreditAttribution: inolen commentedThanks a lot for the detailed review! I'll fix up the issues you brought up and post a more proper patch later tonight.
Comment #5
HaloFX CreditAttribution: HaloFX commentedsubscribe
Comment #6
worldandworld CreditAttribution: worldandworld commentedHi, I have patched the module as per the instructions. but still i am getting the error messages. have anybody get this similarterms working with Drupal 7???
Fatal error: Call to undefined function taxonomy_node_get_terms() in /home/content/w/o/r/worldandworld/html/ReadMalayalam/sites/all/modules/similarterms/similarterms.module on line 204
Comment #7
gmopinillosv CreditAttribution: gmopinillosv commentedHello gays
I setted Similar terms 7.x-1.x-dev on drupal 7.2 and I got the same error. Also, are there a patch update for this issue?
On he other hand, how I set an patch? Sorry I am new in this. Thanks
Comment #8
Gerben Zaagsma CreditAttribution: Gerben Zaagsma commentedsubscribe
Comment #9
Sutharsan CreditAttribution: Sutharsan commentedI did not look at this issue before I stared working a number of hours ago. So I got an unrelated patch which tries do the same, get the module working.
Fixes various problems:
- Wrong path for admin page
- Admin page is empty
- Fixes the mising taxonomy_node_get_terms_by_vocabulary() and taxonomy_node_get_terms() functions
- Move complex php code to preprocess (more todo here).
The original issue is not yet fixed, but a todo with a solution suggestion is added.
Comment #10
Sutharsan CreditAttribution: Sutharsan commentedI've tried to find out how to determine in D7 the type of taxonomy input (multiselect, tagging). But this is not an easy thing. These characteristics are now determined per node type, per field. I see two alternatives: 1. Provide blocks for all vocabularies; 2. Provide checkboxes on the settings page to check the vocabularies for which a block will be provided. Both don't scale very well with large numbers of vocabs, but the second option is the least problematic of the two.
Comment #11
rmiddle CreditAttribution: rmiddle commentedA big shout out to Sutharsan who basic wrote the D7 port of similar by terms. I will push alpha3 now to get some more testing.
Thanks
Robert
Comment #13
bc CreditAttribution: bc commentedI ran into a bug when instantiating more than one similarterms block in a single node page: the usage of drupal_static to define $terms in similarterms_taxonomy_node_get_terms() was the root of the problem. Is there a reason to define $terms as a static variable here?
The module works fine for me when I remove that line.
Comment #14
bc CreditAttribution: bc commentedbetter yet:
Comment #15
Sutharsan CreditAttribution: Sutharsan commented@bc, Please create a new issue for this. Lets keep issues focused to one subject.
Issue status back to closed.