Closed (fixed)
Project:
Phone Number (field)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Dec 2022 at 16:35 UTC
Updated:
17 Mar 2023 at 15:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
heddnComment #3
heddnComment #4
prabuela commentedComment #5
prabuela commentedComment #6
prabuela commentedComment #7
prabuela commentedComment #8
prabuela commentedComment #9
heddnonce js library was only added in 9.2, so this should change to 9.2 || ^10
The default without adding accessCheck is TRUE. Is there a reason to change from the default of TRUE to a FALSE? I'd suggest this should change back to TRUE.
Comment #10
prabuela commented1. 9.2 is updated.
2. Here is the explanation for True and False.
// Unchanged: This gets all articles the current user can view.
$ids = \Drupal::entityQuery('node')
->accessCheck(TRUE)
->condition('type', 'article')
->execute();
// Unchanged: This gets all articles that exist regardless of access.
$ids = \Drupal::entityQuery('node')
->accessCheck(FALSE)
->condition('type', 'article')
->execute();
Comment #11
prabuela commentedComment #12
heddnYes, but adding
->accessCheck(FALSE)is a change of functionality for the module. If no->accessCheck()is added, the default was TRUE. If someone had some custom field access setup for a phone field, that would be a change in functionality for that site. Right? Also, there looks to be 3 accessCheck additions needed in SmsPhoneNumberItem, not just 2.Comment #13
prabuela commentedYes, You are correct whereas, if we want to display only for the current user we can add
(->accessCheck(TRUE)) attached patch below.
For Example:
// This gets all articles the current user can view.
$ids = \Drupal::entityQuery('node')
->condition('type', 'article')
->execute();
// This also gets all articles the current user can view.
$ids = \Drupal::entityQuery('node')
->accessCheck(TRUE)
->condition('type', 'article')
->execute();
There are two entity query is used in the file SmsPhoneNumberItem.
Comment #14
heddnLooking good.
Comment #15
tim-dielsThanks already for the work done!
But the sub module sms_phone_number should also be updated regarding the once library.
And after manually testing I get the error:
Uncaught TypeError: once(...).each is not a functionand the flags are not shown.Comment #16
tim-dielsI've updated the patch to also include the JS in the submodule.
Upgrade status is green.
Manual testings seems fine.
Comment #17
tim-dielsComment #18
tim-dielsTo fast. Updated patch.
Comment #20
tim-dielsThanks everyone!
Comment #21
heddnOn really small nit. And maybe it doesn't matter. And this is looking really good. Thanks for catching the sms omissions. We weren't using it so I forgot to check it.
This is missing an update to the sms.libraries.yml to include core/once.
Comment #22
tim-dielsAs sms_phone_number/element has a dependency on phone_number/element, the dependency should not be needed there?
Comment #23
heddnIt is a minor thing. But since sms uses
oncedirectly and (maybe) someday element might stop using it, it would be safer to include all direct dependencies in sms. But not a huge issue either way. It is a small nit. Thanks for taking this over the finish line.Comment #24
tim-dielsI'll create a follow up issue to address this and fix it there. Thank you also for setting this up to get things going!