- Issue created by @apereira23
- First commit to issue fork.
- π¨πΊCuba jleon1110
After reviewing this issue and analyzing the implementation of the isApplicable() method, I noticed that there is a redundant block of code that performs an entity query to check if the media type exists:
$source_plugin_id = $media_type_storage ->getQuery() ->condition('id', $media_type_id) ->accessCheck(FALSE) ->execute(); if (empty($source_plugin_id)) { return FALSE; }
I think this part of the code is unnecessary, as the media type is already validated later using \Drupal::config('media.type.' . $media_type_id). Additionally, the result of this query is not used anywhere else in the method.
Removing this block would help simplify the logic and avoid an extra query that doesnβt contribute to the final result.
- π¨πΊCuba jleon1110
Iβve reviewed the solution , and I believe itβs ready to be merged.
- π¨πΊCuba jleon1110
The block was removed I think this solution can by merged.
- Merge request !11Issue #3529249 by apereira23, ruby232, jleon1110: Optimization Opportunity in isApplicable() Method β (Merged) created by Unnamed author
-
ruby232 β
committed 145606cc on 1.0.x authored by
pponcedeleona β
Issue #3529249 by apereira23, ruby232, jleon1110: Optimization...
-
ruby232 β
committed 145606cc on 1.0.x authored by
pponcedeleona β