Closed (fixed)
Project:
Fivestar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2011 at 16:51 UTC
Updated:
6 Jun 2012 at 01:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedThis support was added as part of issue #1285084: Support microdata in fivestar.
Are you using the "Stars (rated while editing)" widget? That was the only one I added support for in that issue.
Comment #2
dimon00 commentedI'm too stupid to read...
You are right.
I switched the widged and now the warning disappeared.
Do you plan to extend the support to the "rated while viewing"?
Comment #3
Anonymous (not verified) commentedI'd be happy to review patches and work with a developer to extend this, but I will not be able to do it myself.
I'm hoping to get more developers involved in adding support. There are about 200 different field formatters in contrib (as of August), so we'll need to have more people involved in writing and maintaining the code.
If anyone comes across this issue and wants to write a patch, I'd be happy to offer guidance... if you run into any problems, just ping me.
Comment #4
dimon00 commentedI'm a newbie at best with drupal, php and such... but maybe I can provide some help... with the right amount of support. :)
Comment #5
Anonymous (not verified) commentedOk, I would recommend reading the instructions in the IBM developerWorks article, starting with Enabling Microdata in FIeld Formatters about halfway down, and looking at the patch in #1285084: Support microdata in fivestar.
Note that one thing has changed since I created that patch, the part that is in hook_microdata_field_defaults was updated in #1379244: Update microdata hook for API change.
Comment #6
dimon00 commentedThis is my first attemp to generate a patch so the result could be quite crude.
Even the coding could be far from elegant (I'm not really a developer).
Comment #7
dimon00 commentedComment #8
Anonymous (not verified) commentedGreat, thanks for stepping up on this. It works when I test it by hand. If I have time, I'm going to write automated tests for microdata in Fivestar so new patches can be tested to ensure that we still have correct output.
The only small issue is that there are small formatting issues with whitespace. To see this, you can install the browser plugin Dreditor. This will give you a blue "Review" button. When you click that, you will see some parts that are highlighted in pink; these are the whitespace errors. There are two empty lines that have two spaces on them and 4 lines where a tab is used instead of spaces.
Once those small things are fixed, I think this should be ready.
Comment #9
dimon00 commentedThank you.
I made the corrections.
Is there a Dreditor tool for an editor?
It would be useful to spot the mistakes before submitting the patch.
By the way: have a Merry Christmas. :)
Errata corrige: I don't know why but the patch was a copy of the previous one. I'm not able to delete it.
Comment #10
dimon00 commentedTrying again to submit the above patch.
Comment #11
jinhcc commentedI am using "Stars (rated while editing)" widget, but the microdata mapping field cannot be found, as if this field is not supported. Only itemtype is displayed. After saving I get:
Saved Rating configuration.
Error message
Notice: Undefined index: microdata in microdata_form_field_ui_field_edit_form_submit() (line 519 of /home/name/public_html/drupal/sites/all/modules/microdata/microdata.module).
Warning: Invalid argument supplied for foreach() in microdata_form_field_ui_field_edit_form_submit() (line 519 of /home/name/public_html/drupal/sites/all/modules/microdata/microdata.module).
Any idea how to solve this?
Comment #12
Anonymous (not verified) commentedAre you using the dev version of the module?
Comment #13
jinhcc commentedNope. Using latest alpha 5.
I also encounter a bunch of errors with keyword research module enabled. whenever I click save, I see errors and node cannot be saved. This issue is solved by disabling the keyword research module.
Comment #14
Anonymous (not verified) commentedI can't speak to any other issues besides microdata, but you probably need to try with dev in order to get microdata.
Comment #15
dimon00 commentedI don't think the last bug reported is related to fivestar.
I'm currently getting the same error on "content type page".
The last dev version seems to solve the issue.
Comment #16
remkovdz commentedCan anyone provide some sort of walkthrough on how to setup Fivestar + Microdata?
I have both modules installed and Fivestar is working fine, but I do not know how to get the Microdata module working with Fivestar. I've read a lot of posts about this but couldn't find a solution which doesn't require a patch (which I'm not able to do).
Thanks a lot!
Comment #17
klonos@remkovdz:
Sure you can Remko! ...all you have to do is be able to read and follow well-written instructions:
Applying patches
Applying a patch manually
BTW: #619650: Add help text underneath files on how to apply patches that links to documentation ;)
Comment #18
remkovdz commentedThanks for convincing me, I applied the patch manually..
But... I still don't where to begin with the settings in Microdata. Can anyone help me here?
Comment #19
klonosHaven't played with fivestar + microdata yet, but the handbook page seems like a good start: http://drupal.org/node/1181440
#1516982: Add a "View documentation" link to the project's page (left sidebar, "Resources" section)
Comment #20
ericduran commentedIs this patch still valid?
Comment #21
ericduran commentedBased on linclark last comment, this seems to need work.
Also note #1379244: Update microdata hook for API change has been committed.
Comment #22
dimon00 commented@erikduran: What changes do you need?
changes required by linclark have been inserted into microdata-while-viewing-fivestar-3.patch
Comment #23
Anonymous (not verified) commentedCan someone do manual testing on this both without the patch and with the patch and report the results back here? That will help Eric ensure that the patch is correct.
Comment #24
msedlacek commentedI've installed the latest version of the Fivestar and the patch from entry #10 doesn't seem to correspond to the correct line numbers. Is there an updated patch for the newest version of the FiveStar module? (the 7.x-2.0-alpha2 version from March 28 2012)
Comment #25
klonos@msedlacek: Patches are always against latest dev where available and they also should be tested against it. You can still apply the patch manually. If you do go through the trouble to do that, then please be so kind to post a new patch ;)
Comment #26
msedlacek commentedI tried implementing the above rated while viewing patch in combination with the latest dev version for Microdata (2012-May-04) and I don't see any property data showing up for the review in the source. Is anybody able to help on this? I guess at a basic level I'm not really understanding why there would be support for "rated while editing" and not for viewing, as I'd expect most reviews to be given by anonymous site visitors, and not logged in users. Anyway, if anybody can help with a patch that would be great. I'd be willing to help chip in and pay for the dev work, contact me if interested...
Comment #28
Anonymous (not verified) commentedI rerolled the patch and simplified the logic just a little bit... but I barely touched it, attribution credit should go to dimon00 for figuring this out (nice work!) When this patch is applied, the test in #1385860: Test microdata integration for fivestar module should pass.
NOTE to USERS: To manage this via the UI, the code in #1569442: Microdata: allow users to toggle whether field is item or not must be applied. Until that is marked as fixed, you should apply the patch in that issue.
Comment #29
msedlacek commentedthanks! just applied it and it works for me; (using the following versions)
Microdata 7.x-1.0-alpha5+8-dev
Fivestar 7.x-2.0-alpha2
Comment #30
msedlacek commentedfollow up to previous post. it looks like the aggregaterating property shows up ok in the source code (for me as a property of the Recipe schema, not a child/nested schema), and per the very top I believe there is also a way to do this as a nested schema using the configuration page.
Though, one issue I see in the testing tool and also quoted on this page:
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=1093493
"Google needs certain data to generate a rich snippet preview for each product type. For example, a Review without a reviewer or a Review-aggregate without a count will not generate a preview."
So since the count value for the reviews is also not provided as a property (along with the aggregateReview property) the entire snippet is basically rejected by the Rich snippet testing tool if you include the aggregate rating, and it only works if you then take this out. So is there currently a workaround or way to get the count showing as well? maybe I am missing something? thanks! If I understand this correctly, the functionality is only valid if you also have the count property and without that you will cause Google to basically reject your recipe (or whatever schema you are using) if you include the aggregateReview by itself.
Comment #31
Anonymous (not verified) commentedThanks for testing this patch. Anything specifically dealing with Google's Rich Snippets should move to it's own support request.
Comment #32
ericduran commentedAwesome.
This patches looks good to me, anything else should be in a follow up issue.
Proper commit credit attributed to dimon00 as per linclark comment.
--
http://drupalcode.org/project/fivestar.git/commit/46353d4
Comment #33
dimon00 commentedSorry. I've been busy of late (same as "lazy").
@ericduran For the ratingCount: as msedlacek, I noted the missing property, so I opened a topic sometime ago:
http://drupal.org/node/1445944
but it was closed because the discussion was supposed to take place here.
If you agree I would reopen the other topic. I think to have the ratingCount is really important to proper support microdata on fivestar fields.
Thanks
Comment #34
msedlacek commentedHi dimon00, yes if you could reopen the issue that would be great. per the http://drupal.org/node/1445944 thread you cited the issue would need to be addressed here in this thread. I think that for anyone to get functional or practical use out of the microdata/fivestar combination it needs to have the ratingCount, so that should definitely be included in the future...
ps if anyone is interested, I am currently using a workaround where I pull the ratingCount and aggregate/average values via a computed field and then spit them out with the correct microdata info wrapped, here is an example of the code:
it may not be pretty but works fine for now, validates properly with the rich snippets tool, and is an elegant solution in that it can be neatly undone/removed once the fivestar/microdata fix is implemented)
I had to use css to prevent the info from being displayed twice, which Google says isn't necessarily what they want, but since it validates ok I am content to use it for now...
thanks
Comment #35
ericduran commentedI re-opened the other issues.
Lets solved all the microdata problems :)