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

Problems changing anything on admin/settings #5015

Closed
marcilla707 opened this issue Feb 14, 2018 · 3 comments
Closed

Problems changing anything on admin/settings #5015

marcilla707 opened this issue Feb 14, 2018 · 3 comments
Labels
✋ bug Confirmed bug
Milestone

Comments

@marcilla707
Copy link

Expected Behavior (or desired behavior if a feature request)

Trying to change anything on the /admin/settings page


Actual Behavior

Goes to the "Whoops" page with no changes applied. Here's the ErrorException after enabling debug:

(1/1) ErrorException
count(): Parameter must be an array or an object that implements Countable
SettingsController.php (line 319)

Please confirm you have done the following before posting your bug report:


Provide answers to these questions:

  • Is this a fresh install or an upgrade?
    Fresh Install
  • Version of Snipe-IT you're running
    v4.1.11-pre - build 3307 (master)
  • Version of PHP you're running
    PHP 7.2.1
  • Version of MySQL/MariaDB you're running
    10.1.30-MariaDB
  • What OS and web server you're running Snipe-IT on
    Win7, XAMPP 7.2.1-0
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
    Composer install
  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error

_(1/1) ErrorExceptioncount(): Parameter must be an array or an object that implements Countable

in SettingsController.php (line 319)
at HandleExceptions->handleError(2, 'count(): Parameter must be an array or an object that implements Countable', 'C:\xampp\htdocs\app\Http\Controllers\SettingsController.php', 319, array('request' => object(Request), 'setting' => object(Setting)))_

  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
    ../admin/settings
  • If a stacktrace is provided in the error, include that too.
[2018-02-14 09:49:42] production.ERROR: ErrorException: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\app\Http\Controllers\SettingsController.php:319
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'count(): Parame...', 'C:\\xampp\\htdocs...', 319, Array)
#1 C:\xampp\htdocs\app\Http\Controllers\SettingsController.php(319): count(true)
#2 [internal function]: App\Http\Controllers\SettingsController->postSettings(Object(Illuminate\Http\Request))
#3 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(55): call_user_func_array(Array, Array)
#4 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction('postSettings', Array)
#5 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\SettingsController), 'postSettings')
#6 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Route.php(160): Illuminate\Routing\Route->runController()
#7 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Router.php(572): Illuminate\Routing\Route->run()
#8 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#9 C:\xampp\htdocs\app\Http\Middleware\CheckPermissions.php(28): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#10 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\CheckPermissions->handle(Object(Illuminate\Http\Request), Object(Closure), 'superuser')
#11 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#12 C:\xampp\htdocs\vendor\laravel\passport\src\Http\Middleware\CreateFreshApiToken.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#13 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 C:\xampp\htdocs\app\Http\Middleware\CheckForTwoFactor.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#16 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\CheckForTwoFactor->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 C:\xampp\htdocs\app\Http\Middleware\CheckLocale.php(42): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#19 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\CheckLocale->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php(65): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#22 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#25 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#28 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#31 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Router.php(574): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#32 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Router.php(533): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#33 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Router.php(511): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#34 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#35 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#36 C:\xampp\htdocs\vendor\barryvdh\laravel-debugbar\src\Middleware\Debugbar.php(51): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#37 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Barryvdh\Debugbar\Middleware\Debugbar->handle(Object(Illuminate\Http\Request), Object(Closure))
#38 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 C:\xampp\htdocs\app\Http\Middleware\CheckForDebug.php(25): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#40 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\CheckForDebug->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#42 C:\xampp\htdocs\vendor\fideloper\proxy\src\TrustProxies.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#43 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 C:\xampp\htdocs\app\Http\Middleware\CheckForSetup.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#46 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\CheckForSetup->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#48 C:\xampp\htdocs\app\Http\Middleware\NosniffGuard.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#49 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\NosniffGuard->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#51 C:\xampp\htdocs\app\Http\Middleware\ContentSecurityPolicyHeader.php(18): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#52 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\ContentSecurityPolicyHeader->handle(Object(Illuminate\Http\Request), Object(Closure))
#53 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#54 C:\xampp\htdocs\app\Http\Middleware\ReferrerPolicyHeader.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#55 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\ReferrerPolicyHeader->handle(Object(Illuminate\Http\Request), Object(Closure))
#56 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#57 C:\xampp\htdocs\app\Http\Middleware\XssProtectHeader.php(18): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#58 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\XssProtectHeader->handle(Object(Illuminate\Http\Request), Object(Closure))
#59 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#60 C:\xampp\htdocs\app\Http\Middleware\FrameGuard.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#61 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): App\Http\Middleware\FrameGuard->handle(Object(Illuminate\Http\Request), Object(Closure))
#62 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#63 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#64 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#65 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#66 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#67 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#68 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#69 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#70 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#71 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#72 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#73 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#74 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#75 C:\xampp\htdocs\public\index.php(58): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#76 {main}  
  • Any errors that appear in your browser's error console.
    No errors
  • Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
    error not reproduced
  • Include any additional information you can find in storage/logs and your webserver's logs.
    (pasted in stack trace)
  • Include what you've done so far in the installation, and if you got any error messages along the way.
    Installed successful, Created a user, created a consumable and played with checkouts on that item (which is having issues adjusting quantities and with min QTY. this is already an open case, but just mentioning it since part of what I did during the install), Changed branding but noticed logo not showing. after logging out, noticed logo showing on logon page, Tested emails successfully. Tried to adjust EULA and noticed I couldn't (error). Tried adjusting anything on that page and noticed even changing the checkboxes calls the error. Tried php upgrade.php and cleared cookies/cache and tried changing admin/settings values again, but same error.
  • Indicate whether or not you've manually edited any data directly in the database
    No

I am poking around the rest of the app getting things set up and so far have created a user, categories, manufacturers, companies, edited profile, etc, so other areas of the app seem not to be affected. It's only the admin/settings page I'm having issues with.

Thanks in advance for any help you can provide.

@snipe
Copy link
Owner

snipe commented Feb 14, 2018

Try changing line 319 from:

if (($request->has('show_in_model_list')) && (count($request->has('show_in_model_list')) > 0))

to

if (($request->has('show_in_model_list')) && (count($request->input('show_in_model_list')) > 0))

@marcilla707
Copy link
Author

Looks like that did the trick! Thanks so much for the help!
-MA

@snipe
Copy link
Owner

snipe commented Feb 14, 2018

Great - I'll push that fix into develop shortly. :)

@snipe snipe added the ✋ bug Confirmed bug label Feb 14, 2018
@snipe snipe added this to the v4.1.11 milestone Feb 14, 2018
snipe added a commit that referenced this issue Feb 14, 2018
snipe added a commit that referenced this issue Feb 16, 2018
* Added CSS for table toolbar

* Use maintenances API for table listings

* NIcer layout for allowed_columns in maintenances API

* Fixed #5014 - bootstrap cookie issues

* Fixed #5015 - bug when saving settings

* Refactored datatable code to use data attributes

* Updated dashboard with new table code

* Added - Order by group user count

* Updated groups to use new table attributes

* New license listing table code

* More bootstrap table implementations

* More BS table refactoring

* Improved bootstrap assigned assets

* New bootstrap for reports

* Misc BS fixes

* FIxed small issue with asset history display

* Removed multisort option

* JS refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✋ bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants