This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

keystroke
keystroke

I updated and now have a new dashboard item named "Media". Oh, cool. New stuff! :D Except it doesn't work. I just get this exception....

Call to undefined method Illuminate\Support\Collection::where()
/var/www/calcah.com/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php line 296

And I've been having issues with files. The picture uploader form widgets are broken across the whole dashboard.

I know the where method on Collection was added in Laravel 5, but it does seem as though I have Laravel 5 running under the hood. Not sure how to make sure, upgrade it just in case without harming October though.

Last updated

daftspunky
daftspunky

I would say you need to reinstall October to obtain the Laravel 5 framework. The Beta version of OctoberCMS used Laravel 4 and is no longer supported.

keystroke
keystroke

I did the upgrade instead of fresh installation. You still think that's all it is? If so, I'll give it a try. It hasn't given me any issues since upgrade with my plugins, so I don't know. If it really isn't fully upgraded, then I imagine plugins will be a major healing process. So I guess what I'm saying is.. Was the upgrade process equivalent in that I should have Laravel 5 or is a new install still my best bet? A new install is always a major undertaking. Thanks for the help.

Last updated

keystroke
keystroke

I created a new install and it was hell to pull off, but I think I found the culprit to this issue in the process as well as the culprit to another issue. All were plugins.

I used the installer, and chose to link to the project ID. It brought in the plugins then attempted to create the admin account and failed with....

Call to undefined method Illuminate\Support\Facades\Artisan::call()

So I scrapped it. Used Composer. All went well. Then I logged in, linked the project ID, brought in the plugins, and right at the "Finishing update process" step, it threw the same Artisan::call() error and only three plugins showed as installed though all plugins were downloaded into the plugins directory.

So I removed all plugins that showed as installed, went to OctoberCMS.com, removed plugins I don't use anymore such as Tiipiik.Booking, Rainlab.Todo, and Backend Plus by Indikator. I believe those were the only I removed. I didn't write them down. :( I re-ran the update, and bam, it completed successfully. Then I went to Media where the original Collection::where() error was found. There it was. Still. So I disabled Octoshop. And the Media section worked fine.

On my current installation, I disabled Booking and Octoshop. Still had the Collection::where() error. Then I disabled a private custom plugin I based on Booking and Octoshop and all of a sudden, Media's working on it too.

It seems Booking and/or Octoshop have compatibility issues. Maybe their composer.json requires a different version of Artisan? I dunno. I based some of the components and controllers of my custom plugin on both of those plugins and it caused the Collection::where() issue as well. Both my plugin and Octoshop have composer.json present.

Hope this verbose explanation helps point out bugs for the plugin developers or team. I'll add more info if I spot it myself. Thanks.

Last updated

keystroke
keystroke

Okay, so I realized a similar thing between all three plugins. They all registered settings. I commented out the registerSettings() method in Plugin.php of my custom plugin, disabled the plugin, re-enabled it. Media works for awhile, then (after some cache expires somewhere I guess), it stops working again.

Call to undefined method Illuminate\Support\Collection::where()

Only other thing I can think of is that they all register FormWidgets. I'll poke at that later, but the Media issue is somehow related to these plugins, something they register, or the way plugins in general register something from what I can see. And I'll check out that composer.json

Last updated

keystroke
keystroke

Okay. Easy fix. I removed the illuminate/support package from the plugin's dependencies in vendor/. It wasn't in composer.json? But I removed it from vendor/ and ran composer dump-autoload on the plugin's directory. Works like a charm. The Illuminate/Support package was a 4.2 version. It was overriding the autoload of October's 5.0.* dependency.

De Veste
De Veste

How do i fix this on my webserver? I removed de filesystem and the support directory and then updated but it keeps on giving the same error. Something is not right with the update?

Did a fresh install and keeping the same problem? Tried to update gives me a error first and when i update again it works

Last updated

keystroke
keystroke

Not sure, but removing packages in plugin vendor folders that are already included by October worked after I ran composer dump-autoload. You getting the same error? Collection::where() ??

De Veste
De Veste

On my development system (Windows using Visual Studio) it break on ->where protected function filterContentsByType($contents, $type) { return Collection::make($contents) ->where('type', $type) ->fetch('path') ->values()->all(); }

On my development system (Linux) Call to undefined method Illuminate\Support\Collection::where()

De Veste
De Veste

Its a laravel error so looked up the function it should be: $contents = Collection::make($contents); $contents = $contents->filter(function($value) use ($type) { return $value['type'] == $type; }) ->map(function($value) { return $value['path']; }); return $contents->values()->all();

Dont know why the wrong files are installed by October

De Veste
De Veste

Now it seems to work.

keystroke
keystroke

Because somewhere, the autoloader is loading in Illuminate version 4.2, overriding the Illuminate 5.0 October needs.

In 5.0, the where method was added to Collection.

tcbpepo6029
tcbpepo6029

info7656 said:

Its a laravel error so looked up the function it should be: $contents = Collection::make($contents); $contents = $contents->filter(function($value) use ($type) { return $value['type'] == $type; }) ->map(function($value) { return $value['path']; }); return $contents->values()->all();

Dont know why the wrong files are installed by October

That worked, thanks!!

Tschallacka
Tschallacka

So i had the same issue. It all came down to octoshoplite having their own version of the Illuminate class.

I followed the steps listed above

  1. navigate to plugins/feegleweb/octoshopslite/vendor
  2. delete illuminate folder
  3. run in plugins/feegleweb/octoshoplite composer dump-autoload

then everything was resolved.

maxDubovsky
maxDubovsky

Tschallacka said:

So i had the same issue. It all came down to octoshoplite having their own version of the Illuminate class.

I followed the steps listed above

  1. navigate to plugins/feegleweb/octoshopslite/vendor
  2. delete illuminate folder
  3. run in plugins/feegleweb/octoshoplite composer dump-autoload

then everything was resolved.

Thanks, it worked for me as well !

1-15 of 15

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.