πŸ‡¨πŸ‡³China @wqmeng

Account created on 14 February 2008, almost 17 years ago
#

Recent comments

πŸ‡¨πŸ‡³China wqmeng

Here is another patch file, which could patch to the fivestar lasted 8.x-1.0-alpha5 correctly.
Thanks.

πŸ‡¨πŸ‡³China wqmeng

There is no need to limit the entity type to be comment, while I do not know if there is other case that we need to add a fivestar field to another entity type such as Taxonomy that we vote to Taxonomy item when view it and then submit the vote to the parent content node? If there is a case that we can work with, we could remove this entity type check.

I tried to merge the conflict of this patch to 8.x-1.x, as the old patch file can not patch to 8.x-1.0-alpha5. Hope I do correct.

Thanks

πŸ‡¨πŸ‡³China wqmeng

The 15# patch is the same as the 18# in git repository, not sure why 15# does not apply.

πŸ‡¨πŸ‡³China wqmeng

Hello,

I test the layout builder and fivestar field on the lasted version, both empty vote and voted field, the fivestar widget do not show up.

πŸ‡¨πŸ‡³China wqmeng

Update the patch to support both node and taxonomy entity.
Thanks

πŸ‡¨πŸ‡³China wqmeng

Hello
I submitted a commit to the fivestar-3170189, to fix the fivestar field added to the comment type, and then add the comment to the content type, When you dis-select the "Allow users to re-vote on already voted content" option, the fivestar star hover still active when a user who have already submitted a vote in a previous comment.

How to,

1. Add a comment type such as comment_with_fivestar
2. Add a fivestar field such as field_rating to the above comment type.
a) Select: Rated while editing
b) Enable: Set voting target,
c) Target bridge field: entity_id
d) Target fivestar field: field_rating (this field will need to add to content type movie_review below separately)
e) Disable: Allow users to re-vote on already voted content.

3. Add a content type movie_review, add a comment_with_fivestar comment field to this content type. Add a fivestar field named field_rating same as above 'Target fivestar field' to movie_review.
a) Select: Rated while editing
b) Disable: Set voting target
c) Enable comment of movie_review content type.

4. Create a movie_review node: Movie-A-review
On Movie-A-review node, add a new comment and select the stars to vote and then submit the comment.
Result:
Movie-A-review should show the average rating result in the field_rating added to the Node.
The comment should show the rating of the user.
The star hover should be de-activated if a user have already voted.

I added this in the 8.x-1.0-alpha3+9-dev with a few patches on the Drupal Version 10.1.4-dev, think it should work in D8, and D9 also.

If I have something errors, please let me know.

A patch file added also,

Thanks.

πŸ‡¨πŸ‡³China wqmeng

Hello,

I also find this problem on the Drupal 10.1.4-dev. Here is the error.

What I have modification is to change the method parameter to be the following in the file
web/modules/contrib/commerce_funds/commerce_funds.routing.yml

But it will lose the regex validator, do not know how keep the validation if possible?

Thank you.

commerce_funds.withdrawal_methods.edit:
  path: '/user/{user}/withdrawal-methods/{method}/edit'
  defaults:
    _controller: '\Drupal\commerce_funds\Controller\WithdrawalMethods::editMethod'
    _title: 'Configure Withdrawal Methods'
    link_id: 'commerce_funds.withdrawal_methods.edit'
  requirements:
    _custom_access: '\Drupal\commerce_funds\Access\WithdrawalMethodAccessCheck::checkAccess'
  options:
    parameters:
      user:
        type: entity:user
        method:
          type: string
User warning: Error while validating the route parameter definition in item : This value should be of type array|(Traversable&ArrayAccess). Original data: '^(\\w|-)+$' in Drupal\plugin\ParamConverter\PluginDefinitionConverter->validateParameterDefinition() (line 136 of modules/contrib/plugin/src/ParamConverter/PluginTypeBasedConverterTrait.php).

Drupal\plugin\ParamConverter\PluginDefinitionConverter->validateParameterDefinition('^(\w|-)+$') (Line: 77)
Drupal\plugin\ParamConverter\PluginDefinitionConverter->applies('^(\w|-)+$', 'method', Object) (Line: 61)
Drupal\Core\ParamConverter\ParamConverterManager->setRouteParameterConverters(Object) (Line: 40)
Drupal\Core\EventSubscriber\ParamConverterSubscriber->onRoutingRouteAlterSetParameterConverters(Object, 'routing.route_alter', Object)
call_user_func(Array, Object, 'routing.route_alter', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'routing.route_alter') (Line: 189)
Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 518)
drupal_flush_all_caches() (Line: 95)
Drupal\devel\Controller\DevelController->cacheClear()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 182)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
πŸ‡¨πŸ‡³China wqmeng

Yes, also like this feature.

Production build 0.71.5 2024