- 🇺🇸United States wxman
Does anyone know if there will be a update coming? I added this to a site I'm designing because it does exactly what I need. I'm not a lot of help in fixing problems, though I wish I was.
- 🇺🇸United States wxman
If it helps anyone, I applied the patch in #27 then ran upgrade status.
web/modules/contrib/fivestar/fivestar.module
Line 82: The module is defining "theme_fivestar_preview" theme function. Theme functions are deprecated. For more info, see https://www.drupal.org/node/2575445 → .web/modules/contrib/fivestar/composer.json
Line 0: The drupal/core requirement is not compatible with the next major version of Drupal. Either remove it or update it to be compatible. See https://drupal.org/node/2514612#s-drupal-9-compatibility. - 🇺🇸United States tr Cascadia
A lot of this has now been done in other patches. To see what problems remain, I'm going to try testing against D10 here:
- 🇳🇬Nigeria chike Nigeria
Patch #31 in combination with MR !10 at The jquery.once changes for the module 📌 The jquery.once changes for the module Fixed and patch #3 at Remove 'fivestar_preview' theme function 📌 Remove 'fivestar_preview' theme function Needs work got the module working.
- Status changed to RTBC
over 1 year ago 1:00pm 20 April 2023 - last update
over 1 year ago 4 pass - 🇮🇳India abhinavk
As mentioned in #33, the combination of Patch #31 with MR !10 of The jquery.once changes for the module 📌 The jquery.once changes for the module Fixed and Patch #3 of Remove 'fivestar_preview' theme function 📌 Remove 'fivestar_preview' theme function Needs work makes the module Drupal 10 compatible.
So changing the status to RTBC.
Also uploading a combined patch of all the changes for anyone who needs it.
- Status changed to Active
over 1 year ago 5:47pm 20 April 2023 - 🇺🇸United States tr Cascadia
Please comment in those other issues - that is where those problems are being discussed.
- 🇧🇷Brazil Diego_Mow
Both issues are RTBC.
I'd suggest we get them merged ASAP as they are blockers for future of this module. - 🇮🇳India libbna New Delhi, India
After updating the site to d10, I am trying to apply the #34 patch using drupal-lenient but after running composer install it throws error "Cannot apply patch". Can anyone tell me the reason for this issue? Thannks.
- 🇺🇸United States wxman
Did I miss something that would cause the d10_combined_3287600-34.patch to stop loading just recently? FiveStar not stopped working and I'm back to getting Deprecated function: addcslashes() errors.
- Open on Drupal.org →Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7last update
over 1 year ago Not currently mergeable. - @obriat opened merge request.
- last update
over 1 year ago 4 pass - 🇫🇷France O'Briat Nantes
I made a MR with the latest combined patch from #34, so you could install it with drupal 10 composer :
"repositories": { "fivestar" : { "type": "package", "package": { "name": "drupal/fivestar", "type": "drupal-module", "version": "1.x-dev", "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3287600/", "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af" } } }, "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" }, ...
- 🇺🇸United States wxman
I gave #42 a try.
Problem 1 - Root composer.json requires drupal/fivestar ^1.0@alpha, it is satisfiable by drupal/fivestar[1.0.0-alpha1, 1.0.0-alpha2, 1.0.0-alpha3] from composer repo (https://packag es.drupal.org/8) but drupal/fivestar[1.x-dev] from package repo (defining 1 package) has higher repository priority. The packages from the higher priority repository do not ma tch your minimum-stability and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.o rg/repoprio for details and assistance.
Not sure what's going wrong. I'm running Version: 8.x-1.0-alpha3
- 🇫🇷France O'Briat Nantes
You have to edit your repositories section in composer.json, put this custom repo before the https://packages.drupal.org/8 one.
(I will update my comment to be more clear)
See https://www.computerminds.co.uk/articles/apply-drupal-9-compatibility-pa... - 🇺🇸United States wxman
That's kind of what I did. Here's my composer.json:
"repositories": { "fivestar" : { "type": "package", "package": { "name": "drupal/fivestar", "type": "drupal-module", "version": "1.x-dev", "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3287600/", "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af" } } }, "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" }, "0": { "type": "vcs", "url": "https://github.com/mcaskill/composer-merge-plugin" }, "1": { "type": "composer", "url": "https://packages.drupal.org/8" }, "2": { "type": "composer", "url": "https://asset-packagist.org" }, "3": { "type": "composer", "url": "https://packagist.org" } },
- 🇫🇷France O'Briat Nantes
Where did you see these errors ?
Can you check that the patch is apply to the installed module ?As for your compose.json
"https://packages.drupal.org/8" is the main drupal repo, so its fine (but it's duplicated in the entry "1", so you could safely remove it).I think the packagist ones are useless since it's the default composer repo (https://getcomposer.org/doc/04-schema.md#repositories).
- 🇫🇷France O'Briat Nantes
Note that core requirement should not be places inside a module composer.json requirements, see https://www.drupal.org/docs/develop/creating-modules/add-a-composerjson-... → )
- last update
over 1 year ago 4 pass - 🇺🇸United States wxman
To answer #48 I did not change anything like that.
To answer #47. If you see in my response #45, that is what my composer.json looked like. My other question was regarding whether I should change the 'require' on my composer.json which is
"drupal/fivestar": "^1.0@alpha",
to match your version in the repository:"version": "1.x-dev",
?I know it's long but here's the error
Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Database\Connection->escapeLike() (line 1525 of /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Database/Connection.php) #0 /var/www/vhosts/website.com/testsite/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real() #1 [internal function]: _drupal_error_handler() #2 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Database/Connection.php(1525): addcslashes() #3 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Database/Query/Select.php(431): Drupal\Core\Database\Connection->escapeLike() #4 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(125): Drupal\Core\Database\Query\Select->escapeLike() #5 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(70): Drupal\Core\Entity\Query\Sql\Condition::translateCondition() #6 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(177): Drupal\Core\Entity\Query\Sql\Condition->compile() #7 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(81): Drupal\Core\Entity\Query\Sql\Query->compile() #8 /var/www/vhosts/website.com/testsite/web/modules/contrib/fivestar/src/Element/Fivestar.php(273): Drupal\Core\Entity\Query\Sql\Query->execute() #9 /var/www/vhosts/website.com/testsite/web/modules/contrib/fivestar/src/Element/Fivestar.php(85): Drupal\fivestar\Element\Fivestar::userCanVote() #10 [internal function]: Drupal\fivestar\Element\Fivestar::process() #11 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(1012): call_user_func_array() #12 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(1075): Drupal\Core\Form\FormBuilder->doBuildForm() #13 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(579): Drupal\Core\Form\FormBuilder->doBuildForm() #14 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm() #15 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(224): Drupal\Core\Form\FormBuilder->buildForm() #16 /var/www/vhosts/website.com/testsite/web/modules/contrib/fivestar/src/Plugin/Field/FieldFormatter/StarsFormatter.php(127): Drupal\Core\Form\FormBuilder->getForm() #17 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\fivestar\Plugin\Field\FieldFormatter\StarsFormatter->viewElements() #18 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(265): Drupal\Core\Field\FormatterBase->view() #19 /var/www/vhosts/website.com/testsite/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(266): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple() #20 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple() #21 /var/www/vhosts/website.com/testsite/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents() #22 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents() #23 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple() #24 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build() #25 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array() #26 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback() #27 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback() #28 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #29 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(581): Drupal\Core\Render\Renderer->render() #30 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_views-view-mlayout-5.html_ANXr5Onzt4biZh4u827kbUT5-/oU5uBauK5Ox6_MWEHR8fS9OZp_RzdDMED5l_znZnIUY.php(103): Drupal\Core\Template\TwigExtension->renderVar() #31 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_e2e546e79f8e3b21f07a2b6002aa3215->doDisplay() #32 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling() #33 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display() #34 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render() #35 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template() #36 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render() #37 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender() #38 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #39 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render() #40 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_views-view.html.twig_KWfCQbL2kb8Qiz3628oxhPMt5/kgECs-PdVOEMvpqcJaf9yCmcTtyh-MGo6ZrqhhxHMxY.php(85): Drupal\Core\Template\TwigExtension->escapeFilter() #41 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_db75f6aa28fbdc4591c136018f016cf5->doDisplay() #42 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling() #43 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display() #44 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render() #45 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template() #46 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render() #47 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender() #48 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #49 /var/www/vhosts/website.com/testsite/web/themes/contrib/gavias_remito/gva_elements/gsc_view.php(167): Drupal\Core\Render\Renderer->render() #50 /var/www/vhosts/website.com/testsite/web/themes/contrib/gavias_remito/gva_elements/gsc_view.php(105): Drupal\gavias_blockbuilder\shortcodes\gsc_view->sc_drupal_block() #51 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/templates/frontend/print-builder.php(85): Drupal\gavias_blockbuilder\shortcodes\gsc_view->render_content() #52 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/frontend.php(92): include('...') #53 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/shortcode_block.php(20): gavias_blockbuilder_frontend() #54 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/core/shortcode.php(308): sc_blockbulider() #55 [internal function]: do_shortcode_tag() #56 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/core/shortcode.php(210): preg_replace_callback() #57 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/src/Plugin/Filter/Shortcode.php(40): do_shortcode() #58 /var/www/vhosts/website.com/testsite/web/core/modules/filter/src/Element/ProcessedText.php(118): Drupal\gavias_blockbuilder\Plugin\Filter\Shortcode->process() #59 [internal function]: Drupal\filter\Element\ProcessedText::preRenderText() #60 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array() #61 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback() #62 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback() #63 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #64 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render() #65 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_field.html.twig_9C5uMQbxbPdRTfdZZ1PO7ozmz/lwf3T1OJWuF072xcqDcfz-V0E8qafwG5IleVYP7GS38.php(87): Drupal\Core\Template\TwigExtension->escapeFilter() #66 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_9301eadb69d5c3ea9e6886b2b9a6949b->doDisplay() #67 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling() #68 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display() #69 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render() #70 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template() #71 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render() #72 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender() #73 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #74 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render() #75 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_node.html.twig_JiTjjPoLZm2mq-Tx9g_ymGGgQ/r_0i6LXMvqd5sOU-5vejgkRuG1agjArKjpaxWC3Nk5Q.php(113): Drupal\Core\Template\TwigExtension->escapeFilter() #76 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_ba986af2b0eac7f504389a88fa295e94->doDisplay() #77 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling() #78 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display() #79 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render() #80 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template() #81 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render() #82 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #83 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render() #84 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() #85 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext() #86 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare() #87 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() #88 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() #89 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func() #90 /var/www/vhosts/website.com/testsite/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() #91 /var/www/vhosts/website.com/testsite/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #92 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle() #93 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #94 /var/www/vhosts/website.com/testsite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #95 /var/www/vhosts/website.com/testsite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass() #96 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle() #97 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #98 /var/www/vhosts/website.com/testsite/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #99 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle() #100 /var/www/vhosts/website.com/testsite/web/index.php(19): Drupal\Core\DrupalKernel->handle() #101 {main}
- 🇫🇷France O'Briat Nantes
#48 was a general notice and directed to module maintainer.
#47 the same version should be used in require > "drupal/fivestar": "1.x-dev" and repositories > fivestar > package > "version": "1.x-dev", (I'm not sure if the value matter, but it should be the same in the two spots)
About your error, it seems like a notice about deprecated usage that originated from an entity in src/Element/Fivestar.php(273). That part is not covered by this issue but is tracked in another one: https://www.drupal.org/project/fivestar/issues/3324052 🐛 Deprecated function addcslashes() warning caused by empty value Fixed .
Culd you describe the steps to reproduce this error, so I can test it myself?
- heddn Nicaragua
@TR, any direction on porting this and votingapi to D10? I tried to put forward an effort about 6 months ago and it got bogged down on needing tests. Someone tried to write tests, but that got bogged down too. We're now 4-5 months from loosing D9 support and this pair of modules is the lone blocker to upgrading. What is a workable plan to get us to D10?
Unfortunately, the budget and window I had to push the dial on this 6 months has since dried up. So I'm more interested now as an observer rather then a super active participant. I'm happy to do reviews and confirm any work here still is functional on D10. But don't have a lot of extra time right now.
- 🇺🇸United States wxman
@O'Briat I probably have a bigger problem then. I just made a D9 test site, installed 8.x-1.x-dev, edited the composer.json as you suggested, and added a Fivestar field to a test content. It's working fine with no errors. There must be something else conflicting with it on the other site that's causing the error.
- 🇫🇷France O'Briat Nantes
@wsman, if you are not using ad Drupal 10 coren you could just use the patching system (not need to declare a new repository),e.g.:
{ "name": "test", "description": "test", "license": "GPL-2.0-or-later", "type": "project", "authors": [ { "name": "", "email": "", "role": "Maintainer" } ], "require": { "composer/installers": "^2", "cweagans/composer-patches": "^1.6", "drupal/core-composer-scaffold": "^10.0", "drupal/core-recommended": "^10.0", "drupal/fivestar": "1.x-dev" }, "conflict": { "drupal/drupal": "*" }, "repositories": { "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" } }, "minimum-stability": "dev", "prefer-stable": true, "config": { "allow-plugins": { "composer/installers": true, "cweagans/composer-patches": true, "drupal/core-composer-scaffold": true }, "apcu-autoloader": true, "autoloader-suffix": "Drupal8", "discard-changes": true, "optimize-autoloader": true, "process-timeout": 0, "sort-packages": true }, "extra": { "composer-exit-on-patch-failure": true, "drupal-scaffold": { "locations": { "web-root": "web/" } }, "installer-paths": { "drush/Commands/contrib/{$name}": [ "type:drupal-drush" ], "web/core": [ "type:drupal-core" ], "web/libraries/{$name}": [ "type:drupal-library" ], "web/modules/contrib/{$name}": [ "type:drupal-module" ], "web/modules/custom/{$name}": [ "type:drupal-custom-module" ], "web/profiles/contrib/{$name}": [ "type:drupal-profile" ], "web/profiles/custom/{$name}": [ "type:drupal-custom-profile" ], "web/themes/contrib/{$name}": [ "type:drupal-theme" ], "web/themes/custom/{$name}": [ "type:drupal-custom-theme" ] }, "patches": { "drupal/fivestar": { "Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-04-20/d10_combined_3287600-34.patch" } } }, "scripts": { "post-install-cmd": [ "@composer drupal:scaffold" ], "post-update-cmd": [ "@composer drupal:scaffold" ] } }
- 🇺🇸United States wxman
@O'Briat My main site will be D10 as soon as I can get this all fixed. Fivestar is the last one I need to get working. My temporary site I just made used the latest D9 version, and 8.x-1.x-dev for Fivestar. It's working great with no errors at all. That seems to mean something else on my main site is causing the error.
As a test on my main D9 site witch is using 8.x-1.x-dev, and the edited JSON, I went to the book page it's on and removed the block with the Fivestar rating. The error went away, I added the field back in and the error returned. - 🇺🇸United States wxman
@O'Briat I think I did it! I just couldn't figure out the reference hash, but I think I got it right.
"repositories": { "fivestar" : { "type": "package", "package": { "name": "drupal/fivestar", "type": "drupal-module", "version": "1.x-dev", "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3287600/", "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af" }, "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3324052/", "reference": "51b40c765a37cf34140996e325f2551462d9857e" } } }, "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" }, "0": { "type": "vcs", "url": "https://github.com/mcaskill/composer-merge-plugin" } },
Ran composer update, the drush cr, and all the errors are gone completely. Now after all of this I'm guessing none of it will work on a D10 site yet?
- 🇺🇸United States wxman
Even after all the MR and patches the D10 testing still shows the FivestarTest.php 'assertRaw()' error.
The other two are connected with web/modules/contrib/fivestar/fivestar.libraries.yml. The 'fivestar.base' library, and 'fivestar.ajax' library depending on the core/jquery.once asset library. - Status changed to Needs work
over 1 year ago 8:52pm 24 July 2023 - 🇺🇸United States DamienMcKenna NH, USA
I think this is the appropriate status, given it seems a small change is needed for the Once library.
See https://www.drupal.org/node/3158256 → for details.
- heddn Nicaragua
Re #57: is that handled by 📌 The jquery.once changes for the module Fixed ?
- 🇺🇸United States wxman
I tried adding the MR in #15 in that topic but mine is still showing those errors for D10 upgrades
- Status changed to Active
over 1 year ago 8:06am 25 July 2023 - 🇫🇷France O'Briat Nantes
Here's the drupal-check on the patched module:
./vendor/bin/drupal-check --php8 web/modules/contrib/fivestar 21/21 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ --------------------------------------------- Line fivestar.install ------ --------------------------------------------- 55 Variable $display_map might not be defined. ------ --------------------------------------------- ------ --------------------------------------------------------------------- Line fivestar.module ------ --------------------------------------------------------------------- 95 Function field_read_fields not found. 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols 102 Function field_read_instances not found. 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols ------ --------------------------------------------------------------------- ------ ----------------------------------------------------------------------------------------------------------------------- Line src/Element/Fivestar.php ------ ----------------------------------------------------------------------------------------------------------------------- 215 Method Drupal\fivestar\Element\Fivestar::getElementDescription() should return array but return statement is missing. 293 Call to an undefined method Drupal\Core\Entity\EntityInterface::getOwner(). ------ ----------------------------------------------------------------------------------------------------------------------- ------ --------------------------------------------------------- Line src/Plugin/Field/FieldFormatter/PercentageFormatter.php ------ --------------------------------------------------------- 51 Variable $item might not be defined. ------ --------------------------------------------------------- ------ ----------------------------------------------------- Line src/Plugin/Field/FieldFormatter/RatingFormatter.php ------ ----------------------------------------------------- 51 Variable $item might not be defined. ------ ----------------------------------------------------- ------ ------------------------------------------------------------------------------------------------ Line src/Plugin/Field/FieldFormatter/StarsFormatter.php ------ ------------------------------------------------------------------------------------------------ 126 Method Drupal\Core\Form\FormBuilderInterface::getForm() invoked with 2 parameters, 1 required. 142 Method Drupal\Core\Form\FormBuilderInterface::getForm() invoked with 2 parameters, 1 required. ------ ------------------------------------------------------------------------------------------------ ------ -------------------------------------------------------------------------------------------------------------------------- Line src/Plugin/Field/FieldType/FivestarItem.php ------ -------------------------------------------------------------------------------------------------------------------------- 242 Access to an undefined property Drupal\Core\Field\FieldItemListInterface<Drupal\Core\Field\FieldItemInterface>::$rating. 💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property 274 Call to an undefined method Drupal\Core\Entity\FieldableEntityInterface::isPublished(). 335 Call to an undefined method Drupal\Core\Entity\EntityInterface::getOwnerId(). 336 Call to an undefined method Drupal\Core\Entity\EntityInterface::getValue(). 337 Call to an undefined method Drupal\Core\Entity\EntityInterface::getSource(). ------ -------------------------------------------------------------------------------------------------------------------------- ------ --------------------------------------------------------------------------------------------- Line src/Plugin/Field/FieldWidget/SelectWidget.php ------ --------------------------------------------------------------------------------------------- 25 Call to an undefined method Drupal\Core\TypedData\TypedDataInterface::getFieldDefinition(). 46 Call to an undefined method Drupal\Core\TypedData\TypedDataInterface::getFieldDefinition(). ------ --------------------------------------------------------------------------------------------- ------ --------------------------------------------------------------------------------------------- Line src/Plugin/Field/FieldWidget/StarsWidget.php ------ --------------------------------------------------------------------------------------------- 113 Call to an undefined method Drupal\Core\TypedData\TypedDataInterface::getFieldDefinition(). ------ --------------------------------------------------------------------------------------------- ------ --------------------------------------------------------------------------------------- Line src/VoteManager.php ------ --------------------------------------------------------------------------------------- 82 Call to an undefined method Drupal\Core\Entity\EntityInterface::setVotedEntityId(). 83 Call to an undefined method Drupal\Core\Entity\EntityInterface::setVotedEntityType(). 84 Call to an undefined method Drupal\Core\Entity\EntityInterface::setOwnerId(). 85 Call to an undefined method Drupal\Core\Entity\EntityInterface::setValue(). ------ --------------------------------------------------------------------------------------- ------ -------------------------------------------------------------------------------------------- Line tests/src/Functional/FivestarTest.php ------ -------------------------------------------------------------------------------------------- 61 Variable $displayRepository in PHPDoc tag @var does not exist. 108 Call to an undefined method Drupal\Tests\fivestar\Functional\FivestarTest::assertEquals(). 108 Call to method getText() on an unknown class Behat\Mink\Element\NodeElement. 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols 151 Call to an undefined method Drupal\Tests\fivestar\Functional\FivestarTest::assertEmpty(). 158 Call to an undefined method Drupal\Tests\WebAssert::pageTextContains(). ------ -------------------------------------------------------------------------------------------- ------ ---------------------------------------------------------------- Line tests/src/FunctionalJavascript/FivestarAjaxTestBase.php ------ ---------------------------------------------------------------- 60 Variable $displayRepository in PHPDoc tag @var does not exist. ------ ---------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------- Line tests/src/Kernel/HookFivestarWidgetsAlterTest.php ------ ------------------------------------------------------------------------------------------------------------- 47 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsAlterTest::assertArrayHasKey(). 48 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsAlterTest::assertEquals(). ------ ------------------------------------------------------------------------------------------------------------- ------ -------------------------------------------------------------------------------------------------------- Line tests/src/Kernel/HookFivestarWidgetsTest.php ------ -------------------------------------------------------------------------------------------------------- 60 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsTest::assertArrayHasKey(). 61 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsTest::assertEquals(). 62 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsTest::assertEquals(). 65 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsTest::assertArrayHasKey(). 66 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsTest::assertEquals(). 67 Call to an undefined method Drupal\Tests\fivestar\Kernel\HookFivestarWidgetsTest::assertEquals(). ------ -------------------------------------------------------------------------------------------------------- [ERROR] Found 35 errors
- Status changed to Needs work
over 1 year ago 8:27am 25 July 2023 - 🇫🇷France O'Briat Nantes
@wxman, I pretty sure that you could not set more than one source in a repository. I think you should use the repo to get this issue and use the patch section to apply additional patches. Maybe we could continue this discussion on slack to avoid polluting this thread ?
@DamienMcKenna @heddn, as said in #42 the MR (https://git.drupalcode.org/project/fivestar/-/merge_requests/19/diffs) contains the whole combined patch from #34 which contain the "once" correction provided by #3309729 (which is RTBTC), so this problem should not occur.
- Status changed to RTBC
over 1 year ago 2:07pm 25 July 2023 - heddn Nicaragua
I took the patch from #34 and applied it to a D10 site w/ the lenient composer plugin. I'm able to vote using fivestar widget. I think this is good to go. As far as the readout from drupal-check, all of that seems to be code standard things un related to drupal 10 upgrade.
Given my manual testing, marking RTBC.
- 🇺🇸United States DamienMcKenna NH, USA
Agreed on committing the changes as-is and working on additional fixes as separate issues, e.g. the getForm() method has been that way since at least 8.9: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21Fo...
- 🇫🇷France O'Briat Nantes
I'm concern about the "field_read_fields" function calls in the module file, there are Drupal 7 ones, should I open a separate issue about that ?
- 🇫🇷France O'Briat Nantes
upgrade_status shows no errors or warning, as for drupal-check, there are two issues about that (I miss them :( ) :
https://www.drupal.org/project/fivestar/issues/3224945 📌 Fivestar Element drupal-check issues. Fixed & https://www.drupal.org/project/fivestar/issues/3224943 🐛 FivestarItem drupal-check issues Needs work .As my basic usages are working fine on Drupal 10 without throwing any errors, I think it cold be marked as RTBC
- 🇫🇷France O'Briat Nantes
@heddn Sorry, but most errors are more than just "code standard things": missing function, removed parameters, ... I regroup them in one issue/MR https://www.drupal.org/project/fivestar/issues/3377377 📌 Drupal-check main issue Needs work . IMHO, until these issues are fixed, this module should remain as alpha or beta.
- 🇺🇸United States DamienMcKenna NH, USA
@O'Briat: Nobody is disputing the stability status of the module, we're just focused on getting this change committed.
- 🇨🇿Czech Republic markus_cz
Hi, I'm trying to get my head around what I need to do to update to Drupal 10, and I'm a bit confused. I'd prefer waiting for a release, or even a dev-build with all the changes applied. However, judging by the commit log, no changes have been commited in a year. If I understand correctly, this hasn't been done yet because we're waiting for the module maintainer but they're not active?
- 🇺🇸United States wxman
@markus_cz I've been watching this too for the same reason. I have the whole site ready to upgrade to 10 except for FiveStar. If it's any help to you, Here are parts of my composer.json that I applied patches and MR's:
"repositories": { "fivestar" : { "type": "package", "package": { "name": "drupal/fivestar", "type": "drupal-module", "version": "1.x-dev", "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3287600/", "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af" }, "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3309729/", "reference": "c9dff23c0836d262052c5cf141adfd9dccab594b" }, "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3309729/", "reference": "b696efe72c91170095a9f90dbe271fbe12d8555f" }, "source": { "type": "git", "url": "https://git.drupalcode.org/issue/fivestar-3324052/", "reference": "51b40c765a37cf34140996e325f2551462d9857e" } } }, "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" }, "0": { "type": "vcs", "url": "https://github.com/mcaskill/composer-merge-plugin" } }, "require": { "drupal/fivestar": "1.x-dev@dev", }, "extra": { "patches": { "drupal/fivestar": { "Remove fivestar_preview theme function": "https://www.drupal.org/files/issues/2022-04-06/3273701_3.patch" } }, }
So far everything is working great, and the errors have all gone. Upgrade Status still says it's not compatible though. It's my only one.
- 🇺🇸United States wxman
I am by no means a PHP expert. I understand some of it, and look up what I don't. Please fogive me if this sounds wrong.
Upgrade Status showed three errors. One was in web/modules/contrib/fivestar/tests/src/Functional/FivestarTest.php line 145:
$this->assertRaw('No votes yet', 'Fivestar field has no votes.');
The test says it need to be changed to:
$this->assertSession()->responseContains('No votes yet', 'Fivestar field has no votes.');
The other two were library's in web/modules/contrib/fivestar/fivestar.libraries.yml for the "Remove jQuery dependency from the once feature":
fivestar.base: version: VERSION css: component: css/fivestar.css: {} js: js/fivestar.js: {} dependencies: - core/jquery - core/drupal - core/jquery.once - core/drupal.ajax fivestar.admin: version: VERSION css: component: css/fivestar-admin.css: {} fivestar.ajax: version: VERSION js: js/fivestar.ajax.js: {} dependencies: - core/jquery - core/drupal - core/jquery.once
I read the post regarding that at https://www.drupal.org/node/3158256 → and tried this change:
fivestar.base: version: VERSION css: component: css/fivestar.css: {} js: js/fivestar.js: {} dependencies: - core/drupal - core/once fivestar.admin: version: VERSION css: component: css/fivestar-admin.css: {} fivestar.ajax: version: VERSION js: js/fivestar.ajax.js: {} dependencies: - core/drupal - core/once
I saved, flushed caches, and checked all my pages with Fivestar. Everything worked perfectly and no errors. This goes along with the MR and patch I posted above that come from the people that really do know what they are doing. Upgrade Status still has two errors left on the web/modules/contrib/fivestar/fivestar.info.yml, and web/modules/contrib/fivestar/composer.json that complain about core_version_requirement and drupal/core requirement but that is just a simple fix. Is what I did wrong, because it seems to work?
- ivnish Kazakhstan
Same question as #51
TR, what is the final blocker of the module release with D10 compatibility? Can you explain?
- last update
about 1 year ago 4 pass - Status changed to Needs review
about 1 year ago 9:07am 1 September 2023 - 🇳🇿New Zealand jonathan_hunt
fwiw, applying patch from #72 allows FiveStar to pass the Upgrade Status Drupal 10 readiness checks.
- ivnish Kazakhstan
heddn, I analyzed the patch #34 and the MR. I removed some already committed code so patch is applying to the latest dev version.
As said #75 the patch is successfully applied and passed the Upgrade Status Drupal 10 readiness checks.
Also I manually tested my project and I don't have any problem. Everything works and no any WSOD
- 🇺🇸United States wxman
I just tried installing the latest DEV but it wouldn't let me
- 🇳🇿New Zealand jonathan_hunt
@wxman I simply ran
composer require "drupal/fivestar:dev-1.x"
with no specific references incomposer.json
.composer.patches.json
:"drupal/fivestar": { "#3287600 Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-09-01/fivestar-3287600-72.patch" },
- 🇺🇸United States wxman
@jonathan_hunt I removed everything and added the patch you said. Reran require and all is well now. Thank you.
- heddn Nicaragua
I've opened 💬 Offer to co-maintain Fivestar Postponed: needs info to hopefully keep the ball rolling here.
- 🇺🇸United States wxman
Has something changed? I was getting ready to take the plunge to upgrade the site to 10 and even though I have things still set from #78 I'm now back five star not working and a page full of:
Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Database\Connection->escapeLike() (line 1525 of core/lib/Drupal/Core/Database/Connection.php).
Did I miss something?
- ivnish Kazakhstan
The patch #72 doesn't have "addcslashes" function. Try to find it in another modules
- 🇺🇸United States wxman
@ivnish I honestly don't know what's going on now. I have gone back to a backup copy from a couple of weeks ago, and the error is there on every page there is a FiveStar field. On the pages that it's not used the error doesn't show up. The only patch I'm using is the one shown in #78.
- First commit to issue fork.
- last update
about 1 year ago 4 pass - Status changed to Fixed
about 1 year ago 8:41pm 29 September 2023 - heddn Nicaragua
Given the latest comments in 📌 Remove 'fivestar_preview' theme function Needs work , I'm leaving the dead code for an eventual conversion, or at least we can keep debating how we want to handle its conversion. I tested leaving the code in the code-base and nothing bad happens. It is dead code. Commented as such and committed. A tagged D10 release should come shortly.
Hopefully I got all the right people who were involved on this issue credited. It ended up that most of the work was done in sub-issues and this one really just changes the supported versions in composer.json and .info.yml.
- 🇺🇸United States wxman
Well I made the leap to D10. I installed the latest Fivestar Alpha4. The only error on the the site is Fivestar though. I'm still getting:
Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Database\Connection->escapeLike() (line 1525 of core/lib/Drupal/Core/Database/Connection.php).
I also noticed that the stars can no longer be selected, or edited, like I want to give a book a rating. I know it has to be connected to Fivestar because it only occurs on pages with that field on it.
I have no other patches installing. Is there a Fivestar patch I still need that I'm missing?
- heddn Nicaragua
@wxman can you open a new issue w/ steps to reproduce? Then link it here? Ideally on a fresh/vanilla Drupal 10 install. I'm using this module on a D10 site for several months now and haven't not seen those specific errors in the logs.
- 🇺🇸United States wxman
@heddn I did as you asked: https://www.drupal.org/project/fivestar/issues/3391065 💬 Deprecated function: addcslashes Error on new D10 Site Active .
Automatically closed - issue fixed for 2 weeks with no activity.