Problem/Motivation

Before a stable version, we need to discuss list of tasks to be done.

Proposed resolution

Requirements

  1. #3069201: [META] Improve the style of the Rate widgets
  2. #3069206: Discuss the problem of changing widgets after users voted
  3. #3071645: Custom widget or how to add text to a rate widget?

Done

  1. #2962536: Unify vote types
  2. #2834499: Allow more than one type of voting

    Currently the type of voting used is global. Ideally, you should be able to use more than one type around the site (e.g. fivestar for a product and up/down for an article). Even better, you may want to use more than one type for the same entity bundle.

  3. #2998389: Allow Vote Widget on views
  4. #2848758: Rate cannot be used as Filter criteria
  5. #3064002: Allow sorting views by average votes

Remaining tasks

?

User interface changes

Possible.

Comments

mauritsl’s picture

Status: Active » Fixed

8 months from now, sure I will do that.

Pitfall is that we are dependent on votingapi. I'm not aware of Drupal 8 plans there. Other options are writing our own storage or make it pluggable, but prefer votingapi for d8.

Status: Fixed » Closed (fixed)

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

Time has come’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Sorry, to reopen this.

I'm not a developer, but if I could spare a developer's capacity, I'm Interested in how much work is involved in getting Rate to be Drupal 8 ready for the community?

Or is it necessary to wait until there has been more progress on Voting API?
https://www.drupal.org/node/2203791

And is this process entirely controlled by the maintainer?

mauritsl’s picture

There weren't any updates on the VotingAPI D8 port for 7 months now. Now sure if it will be there.
If possible - we will use the VotingAPI for storage of votes. If not - we should consider writing our own pluggable storage which can be replaced by a VotingAPI plugin later. But that will increase the amount of work to be done, while it doesn't add value in the long run.

Anyway, only the 2.x branch will be ported to D8.

ressa’s picture

I don't have any plans on porting votingapi to D8. IMHO it would need a complete object oriented rewrite.

From Voting API #2379167: Drupal 8 port of Voting API.

pedrorocha’s picture

Hi guys, does anybody knows if any development happened on Rate for D8? I already ported Voting API to D8(please see https://www.drupal.org/node/2379167) and i'm needing some feedback over the approach I chose (with Vote becoming an Entity and VoteResult becoming a D8 Plugin).

Would be great to have inputs from people that will actually extend the module, to see if it's doing good or need to change approach.

mauritsl’s picture

Hi Pedo,
No yet, but D8 is coming closer. I will work on this soon.
I will take a look at VotingAPI in the coming days.

pedrorocha’s picture

@mauritsl, I just released an initial 8.x version of https://www.drupal.org/project/like_and_dislike, that extends Voting API also, so you can see it as an example on how would be to work on Rate 8.x.

I'm open to every feedback at this moment, to see if the approach chose is good to go.

onderd’s picture

hi,

are you planing to relase d8x version soon or are you waiting for the drupal 8 versions of other dependencies?

pedrorocha’s picture

Any work on D8 version for Rate? I need this module features and if someone is developing, we can join forces, otherwise i'll start from scratch.

pedrorocha’s picture

I just released a Voting API alpha version(https://www.drupal.org/node/2721819), that has months of use in production, so it's stable, despite still open to feedback, feature suggestions and API changes.

I'm considering work on Rate 8.x port, so if anyone is willing to help, please let me know.

brenk28’s picture

See the rate D8 thread: https://www.drupal.org/node/2621706

vpeltot’s picture

Priority: Minor » Major
Issue tags: +Composer, +8.x release target

I want to install this module using composer and the new Drupal packages repository (https://packages.drupal.org/8), but no packages are found for this project.

The requested package drupal/rate could not be found in any version

In cause, only 7.x releases exists.
Can you create a new release 8.x-1.x ?

Thanks

kevin.dutra’s picture

Title: D8CX: I pledge that rate will have a full Drupal 8 release on the day that Drupal 8 is released. » Roadmap to 8.x release
Version: 7.x-2.x-dev » 8.x-1.x-dev
Assigned: Unassigned » kevin.dutra
Category: Task » Plan
Issue summary: View changes
Issue tags: -Composer, -8.x release target
andypost’s picture

Nice to see updated summary! Makes sense to add related issues to focus contributors)

kevin.dutra’s picture

Issue summary: View changes
jordik’s picture

Check this issue and the patch included - it enables more than one type of voting.

https://www.drupal.org/project/rate/issues/2834499

It basically allows every entity/content type to have its own rating method.

jordik’s picture

Issue summary: View changes
drdam’s picture

Are Emotion-like vote in the roadmap ?

tepelena’s picture

Are patches from issue 1 and 2 applied to the dev version? It would be nice to post a new release.

kevin.dutra’s picture

Issue summary: View changes

Sorry for the lack of updates -- my schedule went a little crazy recently. I'm hoping to have some time within the next week to make some headway.

@DrDam, what do you mean by "Emotion-like"?

@tepelena, #1 is included in the alpha1 release. #2 has not been committed yet, so it wouldn't be in any release yet.

drdam’s picture

@kevin.dutra : like "funny, mad, angry.." choices ? when you only can choose one

jordik’s picture

@kevin.dutra - what is the reason not adding #2 Allow more than one type of voting to the release?
It is RTBC, works well with the current version, many people are asking for it etc.

kevin.dutra’s picture

@JordiK: once a release is created, nothing else can be added to it. Any commits that are made after that point become part of the following release. I have every intention of adding in #2 before cutting a GA release. I was just pointing out to @tepelena that because it hasn't been committed yet, it would not be in either the alpha1 or dev releases that are currently posted.

tepelena’s picture

Kevin,
Thanks for investing your time in this module. I have been watching this module closely.

On the module page it says it is not ready for D8 production sites. Once the voting issue is committed do you think it is ok to use the module on a live site? If so, you may want to remove/change D8 note on the module page.

Thanks

jordik’s picture

@kevin.dutra - any indication on when #2 can be added? Want to see it in rather soon...

lamp5’s picture

Assigned: kevin.dutra » Unassigned
Issue summary: View changes
krzysztof domański’s picture

Issue summary: View changes
krzysztof domański’s picture

broon’s picture

Issue summary: View changes

I just started to look into D8 Rate module, I have previously used the D7 version quite a while and mostly the custom widget type.

From my test installs and the issues here, I am wondering about the different approach. In D7, I could create several widgets and each of them could be assigned to one or multiple content types. They also had a title which was displayed with the actual rating widget.

Now, in D8, I can only add a single widget type to a content type. So it's not possible anymore to have two or more widgets on a node page (i.e. Thumbs Up/Down for basic rating and Fivestar for more detailed rating). Is this a technical issue or is there any other reason this has been changed? Sorry, if I appear ignorant, but I couldn't find any information on this approach.

As for the title, I already added another issue and also put that into the list here.

krzysztof domański’s picture

1. There are 5 types of widgets available "Fivestar", "Number Up / Down", "Thumbs Up", "Thumbs Up / Down", "Yes / No". Hovewer we have only two vote types: "updown" and "fivestar".

See #2962536: Unify vote types.

2. When you add vote to "Thumbs Up / Down" and you change the type of widget to another one e.g. "Yes / No" the old vote will also appear in the new widget.

Is this a technical issue or is there any other reason this has been changed?

I think it will be hard to adapt it to multiple widgets on the bundle. It requires many changes.

See also #3069206: Discuss the problem of changing widgets after users voted.

jordik’s picture

I think it will be hard to adapt it to multiple widgets on the bundle. It requires many changes.

I think, it would require some thoughts and (lots of) code, but it will not be as complicated, as it sounds in the first place.
It will require changing the logic of the UI settings page and the way the widget is attached to a node. If the structure of the config schema is not changing, then this should be doable. An additional advantage would be (probably) an easier upgrade from D7.

As alternative - there was a comment in one of the older issues about implementing the vote widget as a field, which can be attached to any entity type. Maybe this is also an option, which is worth discussing?

jordik’s picture

In D7 rate widgets are stores as a separate entities. Each widget is configurable via admin/structure/rate/XX/edit.
Since all settings for Rate in D7 are stored as a configuration object in the database, the main tasks would roughly be:
- Modify the D8 rate configuration object (rate.settings) to fit the structure of the D7 config (rate_widgets).
- Adapt the UI for the new settings:
- new settings form (under admin/structure/rate)
- new widget edit form
- lists etc.
- Update hook to transfer the current config to the new structure
- Write additional test for multiple widgets on the same content type

If this option is the way forward (which I think is worth pursuing), I would rather see it implemented before we go for beta.

effortdee’s picture

Paul Broon mentioned here https://www.drupal.org/project/rate/issues/1843902#comment-13203124 that multiple widgets per node type are not possible in D8.

I don't see any other news or information about this as I too require to put a fivestar rating AND a thumbs up rating on the same node.

Rate module says this is possible but in D8 it looks like it actually isn't.

Any more info would be greatly received!

jordik’s picture

I am currently working on porting the Rate widgets form from D7 to D8.

There are two ways to pursue this:
- the Rate D7 way, where you define your widget and their options and then the module puts them on your entity OR
- you define your widgets as fields and attach them to the entity as you would do with a field.
The first option will be more close to D7 and probably will be easier to migrate your current D7 setup to D8.
The second option would have a completely new logic bring more flexibility, as it will not only allow having two different widgets on the same entity (fivestar and yesno), but also more than one of the same widget (multiple fivestar widgets) for more complex ratings.

What I currently have created and tested is the Rate Widget form (similar to the D7), where you can have multiple options (option 1).
Would be accessible under /admin/structure/rate_widgets and store the configurations differently.
Also tested the way to have Rate widget as a field (option 2). Both cases work, but there is still work to be done.

We will have to create a separate issue for this in order to track it there and keep the discussion focused.

tepelena’s picture

Thanks for working on this. The option 2 sounds very promising.

effortdee’s picture

Great work Jordik, interested in option 2 too.

jordik’s picture

Created a separate issue to deal with D7 functionality and multiple widgets on entities.
#3112586: Multiple rate widgets per node and further D7 functionality.
Created a new logic for the rate widgets in a patch there, as in option 2 of comment #35.
Now rate widgets are stored as separate config entities and have separate settings (and possibility for custom options) - much like in D7.
The patch is ready to be tested and it should not impact your current rate widgets or data (but no warranty).

It is a massive leap towards making rate work as in D7 (or even better). Please test the initial patch and provide feedback!
This opens a way for an easier D7 migration and further flexibility.

The test patch (and this way forward) already solves the following issues of the current D8 version (just a small selection, did not check all open issues):
#3110676: Allow user to change vote without clicking undo.
#3045151: Allow multiple votes for user for single entity
#3069201: [META] Improve the style of the Rate widgets
#3069973: Validate whether a value is allowed for a given vote type
#3071645: Custom widget or how to add text to a rate widget?
#3069197: Improve the style of the "Number Up / Down" widget

In my opinion it is the way to go for Rate until beta and on a way to its first stable release.

ravi kant’s picture

Title: Roadmap to 8.x release » Roadmap to 11.x release
Version: 8.x-1.x-dev » 3.0.0

Now we can roadmap for Drupal 11.

jordik’s picture

Title: Roadmap to 11.x release » Roadmap to 8.x release
Status: Active » Closed (outdated)

The whole thread is 4 years old and concerns porting the D7 version to D8, which was done long ago.
Closing this as outdated.