Closed
Description
Describe the bug
After one of the latest updates (not sure which), I can no longer create new Books or Shelves.
After enabling debugging (debugbar) I got the following:
/app/app/Providers/AppServiceProvider.php
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Schema;
use Validator;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Custom validation methods
Validator::extend('image_extension', function ($attribute, $value, $parameters, $validator) {
$validImageExtensions = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'tiff', 'webp'];
return in_array(strtolower($value->getClientOriginalExtension()), $validImageExtensions);
});
Validator::extend('no_double_extension', function ($attribute, $value, $parameters, $validator) {
$uploadName = $value->getClientOriginalName();
return substr_count($uploadName, '.') < 2;
});
// Custom blade view directives
Blade::directive('icon', function ($expression) {
return "<?php echo icon($expression); ?>";
});
// Allow longer string lengths after upgrade to utf8mb4
Schema::defaultStringLength(191);
// Set morph-map due to namespace changes
Relation::morphMap([
'BookStack\\Bookshelf' => Bookshelf::class,
'BookStack\\Book' => Book::class,
'BookStack\\Chapter' => Chapter::class,
Arguments
"Call to a member function getClientOriginalExtension() on null"
When feeding the form a Cover Image I get redirected to the frontpage and get the following debugbar exception:
The given data was invalid./app/vendor/laravel/framework/src/Illuminate/Validation/Validator.php#306
Steps To Reproduce
Steps to reproduce the behavior:
- Setup docker env + BookStack.
- Click "Create New Shelf" or "Create New Book"
- Fill in info and leave out adding a Cover Image
- See error
Expected behavior
To be able to create new Books/Shelves.
Your Configuration (please complete the following information):
- Exact BookStack Version (Found in settings): 0.26.3
- PHP Version: 7.3.7
- Hosting Method (Nginx/Apache/Docker): Docker (custom image/setup - https://github.com/JJTC-Docker/bookstack-ppm)
Additional context
I am running an nontraditional php setup by using ppm https://github.com/php-pm/php-pm
Metadata
Metadata
Assignees
Labels
No labels