Download & Extend

Update microdata hook for API change

Project:Fivestar
Version:7.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The following changes were made in #1329724: Change hook_microdata_field_defaults to hook_microdata_suggestions:

  • hook_microdata_field_defaults was changed to hook_microdata_suggestions
  • the array structure for the hook was changed
  • hooks can now be added in module.microdata.api

The attached patch updates Fivestar's microdata implementation to reflect the changes.

Note: It seems to me that hook_hook_info groups can only access include files in the module's root directory. Because of this, fivestar.microdata.inc is not in the includes directory, but is in root.

AttachmentSizeStatusTest resultOperations
microdata_api_update.patch1.91 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch microdata_api_update.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.View details

Comments

#1

Status:active» needs review

Forgot to mark this as needs review. Just FYI, I was using this as my test case for rewriting the API, so I have tested it myself.

#2

Hey Lin, thanks for this.

This seems rather straight forward. But before we fix this I would like to fix #1386402: Remove entity_get_all_property_info that was added with the microdata patch first. I think we added a function that required entity api. :-/ I haven't looked into it yet. Just mentioning it here in case you get a chance before me.

#3

Status:needs review» needs work

The last submitted patch, microdata_api_update.patch, failed testing.

#4

Status:needs work» needs review

Does this still apply?

#5

Nope, just tried. Curious how is the fivestar.microdata.inc getting loading. I don't see it.

#6

It should load based on my implementation of hook_hook_info in microdata module:

function microdata_hook_info() {
  $hooks['microdata_suggestions'] = array(
    'group' => 'microdata',
  );

  return $hooks;
}

#7

Oh ok, I'm just going to commit this patch cool?

#8

Yeah, that works, thanks!

#9

Lets just make sure it didn't brake any test. Even thought I don't see how that's possible lol.

AttachmentSizeStatusTest resultOperations
fivestar-microdata.diff1.92 KBIdlePASSED: [[SimpleTest]]: [MySQL] 115 pass(es).View details

#10

Status:needs review» fixed

Fixed. Thanks.

--
http://drupalcode.org/project/fivestar.git/commit/89e7852

#11

Status:fixed» closed (fixed)

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

nobody click here