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

[5.5] Fix SQS Queue for PHP7.2 #22374

Merged
merged 1 commit into from
Dec 9, 2017
Merged

[5.5] Fix SQS Queue for PHP7.2 #22374

merged 1 commit into from
Dec 9, 2017

Conversation

laurencei
Copy link
Contributor

@laurencei laurencei commented Dec 9, 2017

Simple fix for issue #22373

Includes a test to prevent regression (this test fails on 7.2 without the fix).

I checked the Git history for this file. We can safely backport this fix all the way back to Laravel 5.1 if you want to backport PHP7.2 support to previous Laravel versions. Let me know, and I'll do PRs for the other versions for you.

@sisve
Copy link
Contributor

sisve commented Dec 9, 2017

Includes a test to prevent regression (this test fails on 7.2 without the fix).

Woho! ;)

@taylorotwell taylorotwell merged commit c55de5e into laravel:5.5 Dec 9, 2017
@laurencei laurencei deleted the fixSqSQueue branch December 9, 2017 21:02
@schystz
Copy link

schystz commented Dec 14, 2017

+1 would love to get the fix for Laravel 5.4 as well :)

@GrahamCampbell
Copy link
Member

Only Laravel 5.5 LTS is supported.

@Szasza
Copy link

Szasza commented Dec 28, 2017

@GrahamCampbell would it be possible to do a release of illuminate/queue as well so Lumen would be patched too?

Thank you in advance for the consideration.

@Szasza
Copy link

Szasza commented Dec 28, 2017

Thank you 🎆

@acaballes
Copy link

acaballes commented Jan 10, 2018

Hi, problem still occurs from laravel 5.5.19 to 5.5.28. "count(): Parameter must be an array or an object that implements Countable" error still occurs.

code li causes the error:
$images = count($this->input('images')) - 1;

@sisve
Copy link
Contributor

sisve commented Jan 10, 2018

@acaballes it would be helpful if you could provide a stack trace or tell us which framework file has the issue, and how to reproduce it.

@acaballes
Copy link

acaballes commented Jan 11, 2018

@sisve I have a form that submits post request for multiple files upload that looks like this for example:

  <input type="file" class="form-control" id="images" name="images[]" onchange="preview_images();" multiple>

...... and submitting the form and handles the post request in /var/www/app/Http/Requests/PostRequest.php:

use Illuminate\Foundation\Http\FormRequest;
class PostRequest extends FormRequest
{
.
.
.
public function rules()
{
     // Text or images validation
     $rules = [
            'text' => 'required_without_all:images.0'
      ];
     $images = count($this->input('images')) - 1; /****** THIS LINE FALSE THE ERROR I REPORTED ***/
     foreach (range(0, $images) as $index) {
           $rules['images.' . $index] = 'image|mimes:jpeg,jpg,gif,png|max:2048';`
     }
     return $rules;
}

.....additional information in Illuminate\Foundation\Http\Kernel handle:

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture() // THIS LINE HAVE 1 ARGUMENT returns Request {#56 ▶}
);
$response->send();
$kernel->terminate($request, $response);

now, I think the request is not capturing and sending the multiple files upload in the form?
Additionally, the post data is not working using Illuminate\Foundation\Http\FormRequest by $this->input('images'), but it works fine using Illuminate\Http\Request by $request->images.

Thanks,
Algie

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

Successfully merging this pull request may close these issues.

7 participants