Skip to content
New issue

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

Resolve other issues with replaced plugin #25

Closed
wants to merge 4 commits into from
Closed

Conversation

mjauvin
Copy link
Member

@mjauvin mjauvin commented Apr 22, 2021

Moving the class_alias if block first resolves the loader issue when replaced plugin is still installed but disabled

…replaced plugin is still installed but disabled
Co-authored-by: Luke Towers <[email protected]>
@mjauvin
Copy link
Member Author

mjauvin commented Apr 22, 2021

@LukeTowers at first glance, do you see a problem running this check first?

@mjauvin mjauvin added this to the v1.1.3 milestone Apr 22, 2021
@LukeTowers
Copy link
Member

No, just so long as we make it clear with those two methods that they have the power to prevent a class that actually exists but hasn't been loaded yet from being loaded; since class_alias() is typically a fallback method instead of an overriding one

@mjauvin mjauvin changed the title Resolve the ClassLoader issue with replaced plugin Resolve other issues with replaced plugin Apr 22, 2021
});
} else {
$this->query->where($this->morphType, $this->morphClass);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not comfortable with having this in the core, it's pretty hacky to have a vendor-specific conditional in the core and there could be a number of unforeseen issues with invisibly grabbing more data than expected by the developer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that what you meant by:

NOTE: We could also explore the idea of having Laravel replace these values at the query level seeing as it's highly likely that other plugins could be extending the replaced plugins and referencing those models in their own data structure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I more so meant doing so at the plugin level through an API of some sort, but wasn't quite sure how it'd work or if it'd even be feasible.

…g replaced plugin models classes"

This reverts commit 745f205.
@mjauvin mjauvin closed this Apr 23, 2021
@mjauvin mjauvin deleted the classloader-fix branch April 23, 2021 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants