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

Bug when doing --update-when-exists #1

Closed
mnowak-umich opened this issue Mar 14, 2023 · 3 comments
Closed

Bug when doing --update-when-exists #1

mnowak-umich opened this issue Mar 14, 2023 · 3 comments

Comments

@mnowak-umich
Copy link

I think there is an error using the update-when-exists option.


 0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
   TypeError 

  array_intersect_key(): Argument #1 ($array) must be of type array, string given

  at vendor/laravel/framework/src/Illuminate/Collections/Arr.php:495
    491▕      */
    492▕     public static function only($array, $keys)
    493▕     {
    494▕         Log::info($array);
  ➜ 495▕         return array_intersect_key($array, array_flip((array) $keys));
    496▕     }
    497▕ 
    498▕     /**
    499▕      * Pluck an array of values from an array.

      +2 vendor frames 
  3   [internal]:0
      Vildanbina\ModelJson\Services\ImportService::Vildanbina\ModelJson\Services\{closure}()

      +16 vendor frames 
  20  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

I think the error is in ImportService.php, starting at line 82. In particular, line 83 is replacing the item array with a single string (usually "id") and that causes line 86 to fail.

@mnowak-umich
Copy link
Author

If I comment out line 83, the import works.

@vildanbina
Copy link
Owner

We had an issue because we had accidentally named two variables with the same name, and now this problem has been resolved in the latest release v1.1.

Thank you for you contribute!

@mnowak-umich
Copy link
Author

mnowak-umich commented Mar 20, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants