- Issue created by @bnjmnm
- ๐ซ๐ฎFinland lauriii Finland
This seems potentially duplicate of ๐ XB pages doesn't respect Pathauto widget Active or maybe there are two separate problems?
- ๐บ๐ธUnited States bnjmnm Ann Arbor, MI
or maybe there are two separate problems?
At least as-reported this issue is different. The problem reported here is specifically about the publish process not respecting the "Generate automatic URL alias" setting, while issue #3525070 states the the problem is a failure to do the desired "Pathauto should skip generating a new path when there is no pattern"
I wouldn't be surprised if the solution to #3525070 occurs in the same place as the solution to the problem reported here, but there's not yet enough info to consider these issues duplicates.
- ๐ซ๐ฎFinland lauriii Finland
Spent few minutes debugging this to make sure this isn't a duplicate and I agree.
It looks like the problem here is that
\Drupal\experience_builder\ClientDataToEntityConverter::setEntityFields
has special handling for boolean fields. However, that handling does not account to the fact that fields can have multiple properties, and therefore other field types could include a boolean field. This is why thepath
field is not being detected for having a boolean, which is added by\Drupal\pathauto\PathautoWidget::formElement
.This problem seems pretty fundamental because you could run into this with other field types too. The simplest example would be Field Union fields. Updating issue summary based on this.
- ๐ซ๐ฎFinland lauriii Finland
I don't think this needs to be postponed. This should work regardless of the States API not working.
- ๐บ๐ธUnited States bnjmnm Ann Arbor, MI
I had this postponed on the State API checkboxes issue becausei I canโt manually reproduce the problem without the State API working with that widget. Based on the above it sounds like this or something else representative of the situation can be reproduce me - could the issue summary be updated with these steps?
- ๐ซ๐ฎFinland lauriii Finland
There could be more than one problem here. I was able to get the boolean accounting to work but regardless of that this is not working. The value is missing when
$items->getValue()
gets called on that field because\Drupal\Core\TypedData\Plugin\DataType\Map::getValue
ignores the pathauto property because per\Drupal\pathauto\PathautoItem
it's a computed field. - ๐ซ๐ฎFinland lauriii Finland
Looks like this is potentially also impacting ๐ Create New Revision checkbox is always unchecked and doesn't create revision Active .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I think @larowlan is uniquely qualified to work on this one โ AFAIK he wrote most of
ClientDataToEntityConverter
. - First commit to issue fork.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Working on this ๐๏ธ
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
AFAIK he wrote most of ClientDataToEntityConverter.
FWIW It was a team effort with Ted
- Merge request !1119Resolve #3526130 Support single checkbox other than boolean item โ (Merged) created by larowlan
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
#14: oh โ sorry, @tedbow! ๐ซฃ
P.S.: ๐ Radio button boolean fields can sometimes can be set in page data form Active seems related?
- First commit to issue fork.
- ๐บ๐ธUnited States tedbow Ithaca, NY, USA
I was looking at why tests/e2e/navigation.cy.js was failing locally, as well as gitlab CI. It looks like the title change is not making into auto-save. Not sure I messed something up when merging or if ๐ If user with less/different permissions edits a page after a user with more/different permissions data lost could occur Active somehow changed something.
I tested manually and I am seeing the none of the page data form elements saving
- ๐บ๐ธUnited States tedbow Ithaca, NY, USA
re #20 I think the problem was that we were not filtering out all submit and button elements, just hardcode for the 'submit' key. Now removing all buttons and submits when setting form input
I think e2e tests are failing now on gitlab but this got
tests/e2e/navigation.cy.js
passing for locally - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Re-running pipeline because Cypress installation seems to be succeeding again after Ubuntu's package system outage. May it pass! ๐ค
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Looks like this is ready for review because passing tests?
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
This looks ready to go to me, I've addressed my own review
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I just made a few clarifications to both the filtering logic and the test coverage to hopefully improve understandability.
This only failed on PHPStan with my changes, because of https://phpstan.org/config-reference#rememberpossiblyimpurefunctionvalues being seemingly quite broken on PHPStan 2. Ideally, we'd be able to flag that
::getRequest()
causes pure functions to no longer be pure; or simpler still: consider ALL functions to be impure in kernel+functional tests?
Either way, out of scope, and pragmatically ignored 2 lines ๐ -
wim leers โ
committed 49d57f84 on 0.x authored by
larowlan โ
Issue #3526130 by tedbow, larowlan, wim leers, bnjmnm, lauriii: \Drupal\...
-
wim leers โ
committed 49d57f84 on 0.x authored by
larowlan โ
I am still able to reproduce this issue:
Steps to reproduce:
- Install Pathauto
- Configure Pathauto pattern for XB pages
- Open XB Page in XB
- Uncheck "Generate automatic URL alias" checkbox
- Edit XB page title to โ Test Page 1
- Publish changes
- Refresh the page
- Observe that Generate automatic URL alias checkbox is again checked and a new path was generated.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
@mayur-sose Pathauto is covered by ๐ XB pages doesn't respect Pathauto widget Active it is a special case because it doesn't store its checkbox value in the entity.
- ๐บ๐ธUnited States effulgentsia
@larowlan: Re #33, can you think of any other steps to reproduce what was fixed in this issue (a different boolean prop of a non-boolean field)? I think @mayur-sose tested with Pathauto because that's what's still in this issue's summary.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Per #32.
Thanks though! Transplanted #32 to that issue: #3525070-12: Make pages compatible with pathauto โ .
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
We added a test module that could possibly be used.
After adding this to your settings.local.php
$settings['extension_discovery_scan_tests'] = TRUE;
drush en -y xb_test_article_fields drush php-eval "\Drupal::keyValue('xb_state')->set('xb_test_article_fields_gravy_state', TRUE);"
That should get you a 'no more gravy' field on the article edit form