@kopeboy
Please, inject services in the class constructor.
Hi guys,
Thank you for being interested in the module. I would recommend removing the lines below from the ReadmehelpMarkdown
class.
* settings = {
* "quick_tips" = "",
* },
It's optional, see: https://api.drupal.org/api/drupal/core%21modules%21filter%21src%21Annota...
Also, please update code in the ReadmeHelpController
class:
$admin_tasks = \Drupal::service('system.module_admin_links_helper')->getModuleAdminLinks($name);
Inject the service as a dependency of the class.
The above solution works for me.
The window
object is replaced with the document
and deprecated jQuery .scroll()
with the .on("scroll").
See:
https://api.jquery.com/scroll/
https://api.jquery.com/scroll-shorthand/
I've tried the #8 🐛 Use theme function for ajax progress Fixed solution to remove the throbber but to no avail.
Can somebody please to explain the rationale behind this throbber or give an advice on how to remove it?
Hi guys,
There is specific issue for migrating to use storybook module:
✨ Remove Deprecatred dependancy - cl_server Needs work
Hi,
I am not sure how people will figure out how to make it working adding just one-liner change in the code.
Please, modify the README.md so we can set up the server just by copy-paste-run commands provided in the file.
@Joe Huggans
Or is it just the CIA installed 2014 Ukraine government you support?
I see your comment as an insult to the Ukrainian people.
As for the "innocent people" on the Russian side, I'd remember your own country history where ALL German people were punished disregarding of their attitude to the Nazi government.
There is no collective guilt, but collective punishment still exists.
Thank you for kind words!
Yes, the main reason for the theme being in beta version is the SDC experimental status. You can notice that all *component.yml
files contain just one attributes
property. This is because the schema does not allow union type declaration, which is required when some component has an optional property or a combination of scalar and object types. See more:
✨ Allow union and intersection types for SDC object properties, just like PHP does Active
I have the same issue when having just one domain in the select list. So the AJAX redirect to the currently selected domain cannot be initiated. I want a domain admin to manage just this particular domain without granting them the "Set the default configuration for all sites" permission.
If I manually add the domain_config_ui_domain
query parameter in the browser address bar and reload the page, then it works as expected.
The MR !3
properly injects dependencies without causing the Circular reference fatal.
@ankondrat4
I think there should be some other way to fix the Circular reference fatal.
Also, because of the issue name we need to fix all Drupal 10 compatibility errors, not just that fatal:
drugan@multidomains-web:/var/www/html$ vendor/bin/phpstan analyze --level=0 web/modules/contrib/domain_role
Note: Using configuration file /var/www/html/phpstan.neon.
7/7 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ------------------------------------------------------------------------------
Line domain_role.module
------ ------------------------------------------------------------------------------
104 Construct empty() is not allowed. Use more strict comparison.
114 Call to function in_array() requires parameter #3 to be set.
115 Implicit array creation is not allowed - variable $newroles might not exist.
118 Implicit array creation is not allowed - variable $newroles might not exist.
133 Construct empty() is not allowed. Use more strict comparison.
------ ------------------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line src/Authentication/Provider/DomainCookie.php
------ -------------------------------------------------------------------------
37 Only booleans are allowed in an if condition, mixed given.
45 Construct empty() is not allowed. Use more strict comparison.
55 Call to deprecated function user_roles():
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
\Drupal\user\Entity\Role::loadMultiple() and, if necessary, an inline
implementation instead.
58 Call to function in_array() requires parameter #3 to be set.
58 Call to function in_array() requires parameter #3 to be set.
63 Call to function in_array() requires parameter #3 to be set.
------ -------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Entity/DomainUser.php
------ ------------------------------------------------------------------------------
38 Call to deprecated function user_role_names():
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
\Drupal\user\Entity\Role::loadMultiple() and, if necessary, an inline
implementation instead.
52 Call to function in_array() requires parameter #3 to be set.
52 Call to function in_array() requires parameter #3 to be set.
74 Call to function in_array() requires parameter #3 to be set.
80 Call to function in_array() requires parameter #3 to be set.
86 Method Drupal\domain_role\Entity\DomainUser::addRole() should return
$this(Drupal\domain_role\Entity\DomainUser) but return statement is missing.
101 Call to function in_array() requires parameter #3 to be set.
103 Method Drupal\domain_role\Entity\DomainUser::removeRole() should return
$this(Drupal\domain_role\Entity\DomainUser) but return statement is missing.
120 Call to function in_array() requires parameter #3 to be set.
123 Call to function in_array() requires parameter #3 to be set.
129 Call to function in_array() requires parameter #3 to be set.
135 Variable property access on $this(Drupal\domain_role\Entity\DomainUser).
136 Variable property access on $this(Drupal\domain_role\Entity\DomainUser).
------ ------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------
Line tests/src/Functional/LoadTest.php
------ ----------------------------------------------------------------------------------------------------
32 Return type mixed of method Drupal\Tests\domain_role\Functional\LoadTest::setUp() is not covariant
with return type void of method Drupal\Tests\BrowserTestBase::setUp().
------ ----------------------------------------------------------------------------------------------------
-- ------------------------------------------------------------------------------------------------------
Error
-- ------------------------------------------------------------------------------------------------------
Ignored error pattern #^Dynamic call to static method PHPUnit\\Framework\\Assert# was not matched in
reported errors.
-- ------------------------------------------------------------------------------------------------------
[ERROR] Found 26 errors
Doesn't that violate the dependency injection requirement?
The DomainCookie::getUserFromSession()
method is called on each page view, so it may become a performance issue.
Anyway, if we go the way suggested, then the DomainCookie::__construct()
method can be omitted at all.
@afinnarn
I've tested your patch and all additions work great. Especially collapsing tags and adding a fragment of the currently expanded operation to the URL.
And yes, the configuration form would be useful. For example, there might be a case when you want to have a bird eye view on all the tags' operations expanded. If we go that way, obviously more defaults might be added so you can set up the UI exactly for your needs.
quietone → credited drugan → .
Rate your excitement about SDC in core: 1 ... 10 | N/A
10
Rate your excitement about potential contrib extending SDC: 1 ... 10 | N/A
10
Rate our documentation: 1 ... 10 | N/A
8
Did you 1️⃣ refactor existing template into a component, or did you 2️⃣ write a component from scratch? 1 | 2
1 & 2
Rate the helpfulness of error messages encountered: 1 ... 10 | N/A
8
Have you tried the Storybook integration? Yes | No
Yes
Any thoughts you would like to share? The sky is the limit
While creating SDC components, I've found that only Drupal\Core\Template\Attribute
class might be set as a property type in the *.component.yml
file. It will be good to use other Drupal classes too.
+
The reason why it is a textfield
is quantity might be integer as well as decimal type of a number too:
1, 123, 0.1, 1.123, 1235.6789, etc ...
So to implement a number
field type here we also need to dynamically set #step
property of the field based on its settings on an order item type. Which we don't know in advance before a customer has selected variation (type) in the list.
To grasp the complexity of the task you can install commerce_xquantity → module and try to play with different quantity number types. It is quite a legal case when some Drupal Commerce site sell its products measured by kilo+grams or liter+milliliters or any other similar unit.
In my mind this game is not worth the candle. Much simpler would be to set a placeholder on the field giving possible value hint for a customer.
Just as an alternative for the solution above you can create database sql view instead and use it as a virtual table to display its fields in a Drupal view using the VDC module.
See how it could done for the mysql database driver: https://dev.mysql.com/doc/refman/8.0/en/create-view.html
Please, see the bottom of the #4 comment:
[ERROR] Found 29 errors
@sarwan_verma
This issue is not about coding standards. Instead, it deals with the Drupal 10 compatibility errors which you can find in the #4 comment 📌 Fix Drupal 10 compatibility related errors Needs work .
As soon as we fix compatibility errors then we can start fixing coding standards errors.
@Ashutosh Ahirwal
Please read my #4 comment. 📌 Fix Drupal 10 compatibility related errors Needs work
@Patryk Padus
The related issue is to look for the diff introduced so now we need to adjust Commerce Bulk for those changes.
Particularly, Drupal Commerce added some methods for a product type like getVariationTypeIds()
.
Before the current issue is fixed the Commerce Bulk should be disabled in case when multiple variation types are used on some of the product types. Otherwise Drupal Commerce will throw fatal error if it ,,sees,, an attempt to call getVariationTypeId()
method on such kind of a product type.
We need to add support for this Drupal Commerce feature:
As a minimum we need to fix the following errors:
drugan@test-commerce-marketplace-web:/var/www/html$ vendor/bin/phpstan analyze -l 0 web/modules/contrib/commerce_marketplace/
38/38 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ------------------------------------------------------------------------------------------------------
Line src/Form/MarketplaceForm.php
------ ------------------------------------------------------------------------------------------------------
117 Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will
be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE
or FALSE to specify whether access should be checked.
💡 See https://www.drupal.org/node/3201242
131 Method Drupal\commerce_marketplace\Form\MarketplaceForm::save() should return int but return
statement is missing.
------ ------------------------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line src/Form/MarketplaceProductForm.php
------ --------------------------------------------------------------------------------------
24 Access to an undefined property
Drupal\commerce_marketplace\Form\MarketplaceProductForm::$entityManager.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------
Line src/Form/MarketplaceShippingMethodForm.php
------ -----------------------------------------------------------------------------------------------------
22 Method Drupal\commerce_marketplace\Form\MarketplaceShippingMethodForm::save() should return int but
return statement is missing.
------ -----------------------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------
Line src/MarketplaceAccessControlHandler.php
------ ------------------------------------------------------------------------------------------------------
25 \Drupal calls should be avoided in classes, use dependency injection instead
30 Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will
be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE
or FALSE to specify whether access should be checked.
💡 See https://www.drupal.org/node/3201242
------ ------------------------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------
Line src/MarketplaceEntityTypeInfo.php
------ -----------------------------------------------------------------------------------------------------
43 Unsafe usage of new static().
💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
61 Method Drupal\commerce_marketplace\MarketplaceEntityTypeInfo::entityOperation() should return array
but return statement is missing.
------ -----------------------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line src/MarketplaceNodeTypeListBuilder.php
------ --------------------------------------------------------------------------------------
21 Access to an undefined property
Drupal\commerce_marketplace\MarketplaceNodeTypeListBuilder::$entitiesKey.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line src/MarketplaceOrderItemTypeListBuilder.php
------ --------------------------------------------------------------------------------------
20 Access to an undefined property
Drupal\commerce_marketplace\MarketplaceOrderItemTypeListBuilder::$entitiesKey.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line src/MarketplaceProductTypeListBuilder.php
------ --------------------------------------------------------------------------------------
20 Access to an undefined property
Drupal\commerce_marketplace\MarketplaceProductTypeListBuilder::$entitiesKey.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/MarketplaceProductVariationAccessControlHandler.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line src/MarketplaceProfileTypeListBuilder.php
------ --------------------------------------------------------------------------------------
20 Access to an undefined property
Drupal\commerce_marketplace\MarketplaceProfileTypeListBuilder::$entitiesKey.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/MarketplaceShippingMethodAccessControlHandler.php
------ ------------------------------------------------------------------------------
48 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------
Line src/MarketplaceStorage.php
------ ------------------------------------------------------------------------------------------------------
101 Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will
be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE
or FALSE to specify whether access should be checked.
💡 See https://www.drupal.org/node/3201242
249 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line src/MarketplaceVariationTypeListBuilder.php
------ --------------------------------------------------------------------------------------
20 Access to an undefined property
Drupal\commerce_marketplace\MarketplaceVariationTypeListBuilder::$entitiesKey.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceClearOwnerLimit.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceClearStoreTypeLimit.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceIncreaseOwnerLimitByOne.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceIncreaseStoreLimitByOne.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceMarkAsDefault.php
------ ------------------------------------------------------------------------------
25 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceMarkAsOwnerDefault.php
------ ------------------------------------------------------------------------------
23 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceSetOwnerLimitToOne.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Action/MarketplaceSetStoreLimitToOne.php
------ ------------------------------------------------------------------------------
24 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Field/FieldFormatter/MarketplaceNameFormatter.php
------ ------------------------------------------------------------------------------
38 \Drupal calls should be avoided in classes, use dependency injection instead
41 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Field/FieldFormatter/MarketplaceTypeLabelFormatter.php
------ ------------------------------------------------------------------------------
58 \Drupal calls should be avoided in classes, use dependency injection instead
82 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
[ERROR] Found 29 errors
This issue has been fixed in the 1.0.0-beta3
release.
This issue has been fixed in the 1.0.0-beta3
release.
@Ashutosh Ahirwal Have you tested the theme?
There is no sense to fix coding standards, typos and similar tasks if, for example some project has fatal errors preventing it from working at all. From you post I see the theme is placed into modules
folder instead of the themes
:
/Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/etc/components/block/block/block.css
Before this project will get its stable release please don't use DrupalPractice
while checking coding standards.
The version: VERSION
line was used for developing purposes and now might be removed. Notice that line will be added by the generate-theme
command again into your_theme.info.yml
file when generating new theme out of the etc
:
https://git.drupalcode.org/project/etc/-/blob/1.0.x/README.md#renaming-t...
The Class definition is empty (empty rule) error is expected. Example:
[data-component-id="etc:menu_local_tasks"] {
/* Add your styles here */
}
I found it very convenient for developing when you click at some element in a browser dev tools and see which .css
file is responsible for theming of the element (component). Even if it has no any specific rules defined yet. Hope you will found it useful too. A rule for the error might be excluded in the theme's phpcs.xml
file.
The same with the Line exceeds 80 characters in README.md
files. It is very rare case when this file is open in a text editor for reading. People either read it online on a https://git.drupalcode.org/project/etc page or use tools like https://github.com/KDE/ghostwriter . Additionally, there are a lot of modules allowing to render this file directly on a Drupal site. So this error also should be excluded in the phpcs.xml
file.
Thanks everyone!
Please address the comment above.
Further development will continue in the 2.0.x branch which is already compatible with Drupal ^9.4 || ^10.
The 8.x-1.x-dev branch might get changes for critical issues only.
📌 Drupal 10 compatibility Fixed
Fixed.
The module has good test coverage, please run tests before asking for review.
Changes in the README.md file are not related to this issue which says:
t() calls should be avoided in class
Please, fix Drupal
coding standards errors introduced by your changes.
This issue has been fixed in the 2.x version of the module.
Please upgrade your installation.
This issue has been fixed in the 2.x version of the module.
Please upgrade your installation.
Readmehelp
dependency removed in the 2.x version of the module.
Please, upgrade your installation.
Okay, now the module has a great test coverage so there shouldn't be bugs anymore.
Closing it.
Adjusted the runRandomNumberDecimalFieldTest()
method to newly added constraints.
This is for xdecimal
filed stress testing using random generated value, min and max.
I think it might be overhead to run this method each time in automatic testing but for debugging purposes you can change "run" prefix for "test" and see what happens.
@mkalkbrenner
I created custom valid step and min and max constraint validators. So now saving xnumber
value programmatically works the same as doing it from the UI.
Also, I added to the XnumberFieldTest
a few lines to save an integer or float (non-string) value on entity xnumber field.
Please check it in your environment and if it's okay I will create 2.0.0-beta1 release.
As you see it is still unmergeable.
Please, properly merge upstream first.
Thanks for reporting.
The reason is that xnumber whenever possible relies on string numbers which actually you get while using a number form widget in the UI.
I've fixed it and now trying to add more tests for saving non-string numbers programmatically on entity field.
Hi,
After the 2.0.0-beta1 release 8.x version of the module will not get changes anymore except critical ones.
Please, fix merge issues and do not forget to follow Drupal git commit guidelines.
Hint: Just copy it from the prompt below.
Because now we have 2.0.0-beta1 version compatible both with 9.x and 10.x core versions so the 8.x version of the module will not get any changes any more except critical ones.
Closing this issue.
Done.
Thanks everyone!
I've ran functional and javascript test on 9.4 and 10.1.2 versions.
I am not sure if there is any sense to merge these changes into 8.x version of the module? If it's true please someone merge upstream and run both tests on the latest 8.x core version to verify that is working there too.
I am going to make 2.0.0-beta1 release tomorrow.
Hi @derekw ,
Have you any progress here?
Hi,
Further development will continue in the 2.0.x branch.
Please, try to fix the following errors and test your changes manually on each of the latest 9.x and 10.x versions:
drugan@test-xattributes-web:/var/www/html$ vendor/bin/phpstan analyze -l 0 web/modules/contrib/commerce_xattributes-3383392/
13/13 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ----------------------------------------------------------------------------------------------------
Line modules/commerce_cattributes/commerce_cattributes.module
------ ----------------------------------------------------------------------------------------------------
45 Inner named functions are not supported by PHPStan. Consider refactoring to an anonymous function,
class method, or a top-level-defined function. See issue #165
(https://github.com/phpstan/phpstan/issues/165) for more details.
------ ----------------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------
Line modules/commerce_cattributes/src/Plugin/Field/FieldWidget/CorrectProductVariationAttributesWidget.php
------ -------------------------------------------------------------------------------------------------------
120 Unsafe usage of new static().
💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
------ -------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------------------------------
Line src/Form/XattributesProductVariationTypeForm.php
------ ---------------------------------------------------------------------------------------------------
92 Method Drupal\commerce_xattributes\Form\XattributesProductVariationTypeForm::save() should return
int but return statement is missing.
------ ---------------------------------------------------------------------------------------------------
[ERROR] Found 3 errors
The test is failing:
drugan@my-xnumber-web:/var/www/html$ vendor/bin/phpunit -c web/core/ web/modules/contrib/xnumber/
PHPUnit 9.6.11 by Sebastian Bergmann and contributors.
Testing /var/www/html/web/modules/contrib/xnumber
EREEEE 6 / 6 (100%)E
Time: 00:10.036, Memory: 4.00 MB
There were 6 errors:
1) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testNumberIntegerField
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
/var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:427
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:556
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
/var/www/html/web/modules/contrib/xnumber/tests/src/Functional/XnumberFieldTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
2) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testNumberDecimalField
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
/var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:427
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:556
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
/var/www/html/web/modules/contrib/xnumber/tests/src/Functional/XnumberFieldTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
3) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testNumberFloatField
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
/var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:427
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:556
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
/var/www/html/web/modules/contrib/xnumber/tests/src/Functional/XnumberFieldTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
4) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testNumberFormatter
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
/var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:427
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:556
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
/var/www/html/web/modules/contrib/xnumber/tests/src/Functional/XnumberFieldTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
5) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testCreateNumberFloatField
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
/var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:427
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:556
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
/var/www/html/web/modules/contrib/xnumber/tests/src/Functional/XnumberFieldTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
6) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testCreateNumberDecimalField
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
/var/www/html/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:427
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:556
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:367
/var/www/html/web/modules/contrib/xnumber/tests/src/Functional/XnumberFieldTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
--
There was 1 risky test:
1) Drupal\Tests\xnumber\Functional\XnumberFieldTest::testNumberIntegerField
This test did not perform any assertions
/var/www/html/web/core/tests/Drupal/Tests/Listeners/DrupalListener.php:65
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:452
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
/var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:144
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:97
ERRORS!
Tests: 6, Assertions: 0, Errors: 6, Risky: 1.
I manually tested it all the actions with the core 9.5.9 version. Hope that will work for earlier ^9 versions too.
There is dependency on the readmehelp_converter_service()
which should be replaced with similar functionality or applied conditionally.
Also, the dependency in the commerce_bulk.info.yml
file should be removed too.
Please, do not forget to manually test your changes on all the actions available.
Quick and dirty compatibility fixes. Everything else might be done later.
Tested it with the core 10.1.2. Works as expected.
Okay, I've missed that keys for the value are different in 10.x and 11.x versions:
- system.css_js_query_string
- asset.css_js_query_string
Will try to set both keys to make it really compatible.
Basically it is the same as the core 11.x asset.query_string
service does:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/includes/comm...
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
I replicated the same logic to make the module compatible with earlier versions of 10.x core.
Seems there is confusion with the module's branches. You can find the config path above at the 1.x but the issue is posted for 2.x version:
https://git.drupalcode.org/project/cl_server/-/blob/1.x/docs/storybook.m...
Let's see if that will not break anything...
I am not able to reproduce it. Even if all Readmehelp modules are disabled on the /admin/config/system/readmehelp-settings page we get an empty array here:
$readmehelp_modules = \Drupal::config('readmehelp.settings')
->get('readmehelp_modules');
As for the second error you do not need to depend on the Readmehelp in your custom modules anymore. It scans all enabled modules and if some of them has no hook_help()
implementation and has README.md in its directory then it will be rendered on a /admin/help/your_module page.
You can manually disable / enable the Readmehelp support on the settings page above. If you are unsure which modules are eligible for this kind of support just reinstall the Readmehelp and it will discover that for you automatically.
See more: 📌 Allow using the readmehelp for all modules with no module help. Fixed
Add an example how to add html attributes to a local task. The same applies to a local action defined in a example_module.links.action.yml
file.
Hi @shivam_tiwari,
The readmehelp
dependency is already fixed on the 2.0.x branch. Additionally, to make the module fully compatible with the core's ^10 version wee need to rewrite the XnumberFieldTest.php
. See #17 comment.
Because we have the Extended number field types so at the very least we need guarantee the Drupal Core functionality for these types.
For the beginning you can just copy two files below into our Tests folder. Then replace 'integer', 'decimal', 'float' field types in the files for our 'xinteger', 'xdecimal' and 'xfloat'.
The same with the field widget type: 'number' -> 'xnumber'. After that just create a list of what we've extended in the core's functionality and add specific test methods for that in the files:
https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/fie...
https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/fie...
Fixed both for the 2.0.x
and 8.x-1.x
versions.
@mvonfrie
Let's make it compatible with the ^9.5 || ^10
versions.
You can commit --amend
and then push --force
into your MR branch.