Log1x / poet

Configuration-based post type, taxonomy, block category, and block registration for Sage 10.

Home Page:https://github.com/Log1x/poet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MediaCloud Plugin overrides Illuminate collapse() function

conradfuhrman opened this issue · comments

Reaching out as I'm not sure how to solve this one. MediaCloud's (https://mediacloud.press/) uses similar Illuminate classes that define the collapse() method and it seems to be overriding Poet's use of collapse() directly from the Illuminate vendor. I've reached out to MediaPress to see if this is something they can resolve, but haven't heard back. I was curious if this is something that is a scoping issue or similar. I've actually never run into this before.

Of course, I'm happy to help resolve, test, etc., but this is a bit out of my comfort zone on where a solution might be. Appreciate your work and really want to give Poet a try!

hmm strange. is it throwing an error?

No explicit error, but when MediaPress is disabled everything works awesome. When it's enabled I did a var_dump on the collection chained methods and collapse returns an empty array rather than the proper response of the post types.

The method from MediaPress is slightly different so that's where my assumption lies with their class.

So technically it's a soft failure. Also this is a brand new Sage 10 project and MediaPress is currently the only plugin other than ACF.

Confirmed the issue. Will try to push a fix tonight.

That's amazing! Looking forward to seeing how you resolved it and thanks a ton for providing a fix.

Going to test tonight the newest version 4.2.5 as it looks like a lot updated from MediaPress. Will let you know if the issue still persists.

Tested with 4.2.5. Still have the same issue unfortunately.

yeah. annoyingly they are autoloading helpers.php from their old Illuminate\Support\Collection and it's registering the collect() helper before Sage's. I fixed it on https://github.com/Log1x/poet/pull/16/files but it's not stable yet.

its likely for inconsistencies like this to show up elsewhere down the road unless they were to fix registering their custom collect in the global namespace.

Gotcha. Anything I can do to help?

If you have time to burn, feel free to try that PR so far. I will have to swing back around to it tonight – I honestly can't remember where I left off. :(

Sounds good, I'll fork it and see what I come up with in the next day or two.