EntityQuery accessCheck() false positive if chaining conditions
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 43/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- php
- Ambito
- testing-qa, tooling
Direzione di ricerca
Start by tracing the rule that detects calls to EntityQuery::accessCheck() and compare how it handles chained calls with the non-chained example in the issue. Add coverage for both chain orderings and confirm the rule no longer reports a false positive when accessCheck(FALSE) is present. The issue does not name the rule or test files, so locate them from the reported deprecation message.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug report
When an EntityQuery::accessCheck() call is chained with other methods it is not detected.
This is similar to #437 but possibly requires a different fix.
Code snippet that reproduces the problem
This yields a Relying on entity queries to check access by default is deprecated error:
$storage = \Drupal::entityTypeManager()->getStorage('node');
$query = $storage->getQuery();
$query
->accessCheck(FALSE)
->condition('field_myfield', TRUE);
$entity_ids = $query->execute();
The ordering doesn't matter, if the accessCheck() is last, the error still occurs:
$storage = \Drupal::entityTypeManager()->getStorage('node');
$query = $storage->getQuery();
$query
->condition('field_myfield', TRUE)
->accessCheck(FALSE);
$entity_ids = $query->execute();
When the calls are not chained, the rule works correctly. This does not yield an error:
$storage = \Drupal::entityTypeManager()->getStorage('node');
$query = $storage->getQuery();
$query->accessCheck(FALSE);
$query->condition('field_myfield', TRUE);
$entity_ids = $query->execute();
- Lingua principale
- PHP
- Stelle
- 208
- Fork
- 88
- Merge medio
- 2g 6h
- PR unite (30g)
- 8
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mglaman/phpstan-drupal
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
mglaman/phpstan-drupal#1078 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
mglaman/phpstan-drupal#1079 ·
I maintainer di solito rispondono entro 1 giorno
-
Report constraint plugins that break on Drupal 12 because they have no named-arguments constructorForse già presa @goba l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
mglaman/phpstan-drupal#1075 ·
I maintainer di solito rispondono entro 1 giorno
-
Magic properties: original on entities, name on UserSession and password on User are not reported as deprecatedForse già presa @goba l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
mglaman/phpstan-drupal#1074 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
mglaman/phpstan-drupal#1051 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di mglaman/phpstan-drupal
Issue simili
-
bug SH_K
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
McNamara84/ernie#1540 ·
I maintainer di solito rispondono entro 1 giorno
-
Перевод устарел
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
php/frankenphp#2829 ·
I maintainer di solito rispondono entro 1 giorno
-
30-minutes algorithm any-language beginner-friendly c community cpp csharp data-structures go good first issue hacktoberfest help wanted kotlin learning leetcode php ruby rust swift
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 85/100
Huerte/algo-solutions-python#211 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PrestaShop/PrestaShop#43497 ·
I maintainer di solito rispondono entro 1 giorno