We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recently found this by chance
It seems that since FileLinkTracking is attached to the dataobject, it runs for classes that are not relevant (eg: LoginSession)
By checking if there are actually any DBHTMLText, the query is not happening anymore
// Build a list of HTMLText fields, merging all linked pages together. $allFields = DataObject::getSchema()->fieldSpecs($this->owner); $linkedPages = []; $anyBroken = false; $hasTrackedFields = false; foreach ($allFields as $field => $fieldSpec) { $fieldObj = $this->owner->dbObject($field); if ($fieldObj instanceof DBHTMLText) { $hasTrackedFields = true; // Merge links in this field with global list. $linksInField = $this->trackLinksInField($field, $anyBroken); $linkedPages = array_merge($linkedPages, $linksInField); } } if (!$hasTrackedFields) { return; }
The text was updated successfully, but these errors were encountered:
Don't make query if not needed
5cce496
See silverstripe/silverstripe-assets#557 for background
same thing for SiteTreeLinkTracking
maybe i'm missing something, but these changes seem to save two queries :-)
Sorry, something went wrong.
Don't make query if not needed (#2863)
3295dd5
* Don't make query if not needed See silverstripe/silverstripe-assets#557 for background * add comment
Both PRs are merged. Thanks for that.
No branches or pull requests
Recently found this by chance
It seems that since FileLinkTracking is attached to the dataobject, it runs for classes that are not relevant (eg: LoginSession)
By checking if there are actually any DBHTMLText, the query is not happening anymore
PRs
The text was updated successfully, but these errors were encountered: