Found 38 issues

First time here? 👋

Welcome to Find a PR.

Find a PR is an open-source site that is built to help developers find projects so that they can submit their very first pull request.

If you're a contributor looking to find a project to contribute to, feel free to browse through the list below.

If you're a maintainer looking to list your project on Find a PR, you can read how to do this in the documentation.

bug help wanted

When attempting to filter tests by test or file name pressing the "Enter" key has no effect.

Pressing "Enter" at the default screen correctly triggers a "test run" where all tests are run.

View more
4 comments
ntwb

ntwb

25th Feb 2018 @ 10:49

help wanted hacktoberfest good first issue documentation

We are logging activity of several models, some using SoftDeletes trait and others not.

When we set config option 'subject_returns_soft_deleted_models' => true then calling subject() on any model not using SoftDeletes trait throws an exception: Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed().

Can the subject() method below be made to check first whether the Model uses the SoftDeletes trait? Or perhaps check whether withTrashed() is a defined method on the Model? I tried a few things but couldn't figure out how to get the class of the Model..

https://github.com/spatie/laravel-activitylog/blob/68eb6e65382f94fe86ce5ff6572159f80d024ba9/src/Models/Activity.php#L28-L35

View more
26 comments
bluec

bluec

7th Nov 2018 @ 13:44

help wanted

Hello,

I noticed that there is an incompatibility with the mbstring polyfill and PHP 8.1 / Alpine Linux, which breaks a lot of my projects as soon as the php81-mbstring is not installed, but php81-iconv is installed:

Example:

Warning: iconv(): Wrong encoding, conversion from "ASCII" to "UTF-8//IGNORE" is not allowed in phar:///var/www/localhost/htdocs/phpstan.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 736

It looks like //IGNORE is not accepted since echo iconv('UTF-8', 'UTF-8', 'test'); works, while echo iconv('UTF-8', 'UTF-8//IGNORE', 'test'); doesn't

View more
2 comments
danielmarschall

danielmarschall

7th Jan 2022 @ 00:12

help wanted findapr
protected $listeners = [
        'sweetalertConfirmed',
        'sweetalertDenied',
];
public function logout()
{
        sweetalert()
            ->timer(0)
            ->showDenyButton()
            ->addInfo('confirm or deny action');
}

public function sweetalertConfirmed(array $payload)
{
        auth()->logout();
        sweetalert()->addSuccess('sweetalert was confirmed');
}

public function sweetalertDenied(array $payload)
{
        sweetalert()->addError('sweetalert was denied');
} 

i have code for laravel 10 and livewire 3 and get Uncaught TypeError: Livewire.components is undefined when i click button logout, here my button logout:

<a wire:click.prevent="logout" href="#" class="nav_link" data-bs-toggle="tooltip" data-bs-title="Logout">
    <i class='bx bx-log-out nav_icon'></i>
    <span class="nav_name">Logout</span>
</a>

how can fix this code

View more
andhikapepe

andhikapepe

12th Dec 2023 @ 05:38

bug help wanted

Laravel Version

10.45.0

PHP Version

8.3.1

Database Driver & Version

No response

Description

When using Tailwind's container queries plugin with the @class directive, Blade either throws exceptions about unexpected endif or simply doesn't compile the classes correct. Using Arr::toCssClasses directly works as expected.

The following examples are in the reproduction repo. (Note: Tailwind isn't installed and configured, but it isn't necessary to show the issues with the Blade compiler.)

Code that works

/success shows everything working as expected with the Arr::toCssClasses

I suspect this is working due to Blade wrapping everything in e().

Here's a snippet of the code that works (full example in the repo):

@if (filled($heading))
    <h1
        class="{{
            Illuminate\Support\Arr::toCssClasses([
                'font-bold tracking-tight text-gray-900 @xs:text-4xl @md:text-6xl',
                'mt-10' => filled($callout),
                '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout)
            ])
        }}"
    >
        {{ $heading }}
    </h1>
@endif

@if (filled($description))
    <div
        class="{{
            Illuminate\Support\Arr::toCssClasses([
                'text-lg/8 text-gray-600',
                'mt-6' => filled($heading),
                'mt-10' => filled($callout) && blank($heading),
                '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout) && blank($heading),
            ])
        }}"
    >
        {{ $description }}
    </div>
@endif

Code that throws an exception

/failure shows the exception (though this may be compounded by wrapping the HTML in conditionals)

Here's a snippet of the code that throws an exception (full example in the repo):

@if (filled($heading))
    <h1
        @class([
            'font-bold tracking-tight text-gray-900 @xs:text-4xl @md:text-6xl',
            'mt-10' => filled($callout),
            '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout)
        ])
    >
        {{ $heading }}
    </h1>
@endif

@if (filled($description))
    <div
        @class([
            'text-lg/8 text-gray-600',
            'mt-6' => filled($heading),
            'mt-10' => filled($callout) && blank($heading),
            '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout) && blank($heading),
        ])
    >
        {{ $description }}
    </div>
@endif

Code that compiles incorrectly

/incorrect is the same thing as /failure but without the conditionals (you can see that the content of the @class call is simply output on the page)

Here's a snippet of the code that compiles incorrectly (full example in the repo):

<h1
    @class([
        'font-bold tracking-tight text-gray-900 @xs:text-4xl @md:text-6xl',
        'mt-10' => filled($callout),
        '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout)
    ])
>
    {{ $heading }}
</h1>

<div
    @class([
        'text-lg/8 text-gray-600',
        'mt-6' => filled($heading),
        'mt-10' => filled($callout) && blank($heading),
        '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout) && blank($heading),
    ])
>
    {{ $description }}
</div>

Steps To Reproduce

https://github.com/agentphoenix/class-directive-bug

View more
8 comments
agentphoenix

agentphoenix

21st Feb 2024 @ 02:24

enhancement help wanted hacktoberfest

Describe the bug I have a table which has an order column. When I reorder the elements I update each model with the new order. Because the table has some large JSON columns I select only id and order columns for efficiency. I set the new order and save the model.

foreach (Faq::query()->get(['id', 'order']) as $faq) {
    $faq->order = $newOrder[$faq->id];
    $faq->save();
}

The diffs created in the activity_log table look like this:

{
   "old": {
      "order": 1,
      "answer": null,
      "question": null
   },
   "attributes": {
      "order": 2,
      "answer": "long JSON content",
      "question": "long JSON content"
   }
}

From what I see laravel-activitylog fetches the model with all columns from the database before creating a log entry which kind of defeats the purpose of my "select list optimization" and produces an incorrect diff.

Generally I want these large JSON columns to be logged in case a user changes them but in this case I only change the order column so I would like to see only the order column in the diff.

I have tried running these updates straight off the Eloquent builder:

Faq::query()->where('id', $id)->update(['order' => $newOrder[$id]]);

but in this case nothing is logged.

I have the following activitylog configuration for my models:

public function getActivitylogOptions(): LogOptions
{
    return LogOptions::defaults()
                     ->logAll()
                     ->logOnlyDirty()
                     ->logExcept([
                         'id',
                         'created_at',
                         'updated_at',
                     ]);
}

To Reproduce Select a subset of columns from the database, change these columns, save the model and see that other (not initially selected) columns are present in the diff.

Expected behavior Only columns that've actually been changed should be present in the diff.

Versions

  • PHP: 8.1
  • Database: MySQL 8
  • Laravel: 9.31.0
  • Package: 4.6.0
View more
5 comments
KKSzymanowski

KKSzymanowski

28th Sep 2022 @ 21:53

enhancement help wanted
  • standard tags
  • input fields
  • components
  • patterns

Add code snippets for each block

View more
👍 1
willemvb

willemvb

25th Jul 2016 @ 12:49

help wanted

Ray allows for a meta.project_name to be set for when you use a separate Ray window for each project.

View more
riasvdv

riasvdv

21st Mar 2022 @ 08:49

enhancement confirmed ui low priority help wanted

Package

filament/filament

Package Version

3.2.35

Laravel Version

10.3.3

Livewire Version

3.4.6

PHP Version

8.3

Problem description

There's a pretty jarring visual glitch when using non-native select fields. This is what is shown while the field is loading:

It's very noticable for people on slow connections. See this video: https://www.youtube.com/watch?v=Ruax9OpgDmU

I understand that the js is lazy loaded (and that's great) but I think there should be a better placeholder while the field is still loading. Currently UI looks broken for several seconds for people on slow connections. It's also an issue when the server is far away from the user (eg. Australia -> Germany) regardless of connection speed.

The large white box with the dropdown arrow that shows while the field is loading isn't clickable either, which is even more confusing for users.

Expected behavior

Non-native select fields should have some kind of placeholder while Choices.js is loading to prevent them from looking broken.

Steps to reproduce

  1. Launch the reproduction repository
  2. Open the browser and throttle the connection to 2G
  3. Clear the browser cache, then open the create product page

The select will look broken for a few seconds.

Reproduction repository

https://github.com/binaryfire/filament-reproduction-repo

Relevant log output

No response

View more
1 comment 👀 1
binaryfire

binaryfire

22nd Feb 2024 @ 02:36

enhancement help wanted

Figure our a way to show a grayed out Laravel logo as a default avatar instead of the current default GitHub one.

View more
8 comments
driesvints

driesvints

29th Sep 2021 @ 10:48

bug confirmed ui help wanted medium priority

Package

filament/filament

Package Version

v3.2.16

Laravel Version

10.42.0

Livewire Version

v3.4.4

PHP Version

8.2.11

Problem description

I was adding several columns to a table and enabling the individual search for them all. Both a table scroll bar and the body/bottom scroll bar appear

Expected behavior

Only the table's horizontal scrollbar should appear

Steps to reproduce

Add a column that can't be shown on screen and enable its individual search

Reproduction repository

https://github.com/magarciasantos/filament-table-overflow-bug.git

Relevant log output

No response

View more
2 comments
magarciasantos

magarciasantos

29th Jan 2024 @ 20:28

help wanted

Currently, for plural rules, the MessageFormatter polyfills uses the English rules for all locales (it ignores the locale). To be consistent with what we do in symfony/intl (used by symfony/polyfill-intl-icu to implement NumberFormatter and DateFormatter), we should rather fail explicitly here (using the English rules for a different locale would not give the right result anyway)

View more
2 comments
stof

stof

23rd Oct 2018 @ 15:34

help wanted

I would be good to support normalizer_get_raw_decomposition function that appeared in PHP 7.3. I've tried to implement it but seems that existing decomposition data is already optimized to get the final decomposition. Example test case is available here. Pinging @nicolas-grekas as he is the author of Normalizer polyfill.

View more
4 comments
IonBazan

IonBazan

12th May 2018 @ 23:26

help wanted

When encountering nested tokens, they are parsed only during formatting, not when compiling the pattern. And the type of tokens are validated only during the rendering as well. But the native implementation detects such error during the instantiation: https://3v4l.org/Sf69D This means that the error handling required for the polyfill is not the same than for the native implementation.

View more
stof

stof

23rd Oct 2018 @ 15:58

enhancement help wanted hacktoberfest

Found the \Illuminate\Database\Eloquent\Concerns\HasAttributes::originalIsEquivalent() method during code diving and it should be usable for our trait! 🎉 This PR would be mainly reasearch when that method was added, if it's compatible with our version support rules and switching our own change detection logic with the core one.

View more
3 comments
Gummibeer

Gummibeer

20th Oct 2021 @ 10:03

help wanted

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I have checked that the bug-fix I am reporting can be replicated.

Description of the problem

One of the important reasons for using hyperscript is that it handles escaping of characters which are reserved in html. Which prevents XSS.

spatie/html-element does not do this. Mainly because it uses strings as intermediate format instead of an object representation of the DOM.

View more
6 comments 👍 3
Erikvv

Erikvv

1st Feb 2018 @ 02:19

enhancement help wanted

Discussed in https://github.com/spatie/schema-org/discussions/202

Originally posted by indyjonesnl January 10, 2024

$lodgingBusiness = Schema::lodgingBusiness()
  ->openingHours(
    Schema::openingHoursSpecification()
      ->dayOfWeek([Schema::dayOfWeek()::Monday])
      ->opens(new DateTime('09:00:00'))
      ->closes(new DateTime('17:00:00'))
  )
  ->checkinTime(new DateTime('14:00:00'))
  ->checkoutTime(new DateTime('11:00:00'))

This results in the current date + time being included in the output "opens":"2024-01-10T09:00:00+00:00","closes":"2024-01-10T17:00:00+00:00" and ..."checkinTime":"2024-01-10T14:00:00+00:00","checkoutTime":"2024-01-10T11:00:00+00:00"...

While the Schema should contain only the time, formatted as 14:30:00+08:00.

Can someone point me in the right direction?

View more
Gummibeer

Gummibeer

11th Jan 2024 @ 13:12

enhancement help wanted good first issue

Server is down with 503 error when loading big pdf(8Mb, 40 pages). It's because you puting file in construct method Imagick.

$this->imagick = new Imagick($pdfFile);

But why whole file if i need only one page. In method getImageData there is instruction that page is need use for generate preview.

$this->imagick->readImage(sprintf('%s[%s]', $this->pdfFile, $this->page - 1));

If you need read all file don't indicate index of page. Like this:

$this->imagick->readImage($this->pdfFile);

After then i deleted file from constructor Imagick

$this->imagick = new Imagick();

And all works fine. If you want pick another page there is method setPage

View more
2 comments
truechernyshov

truechernyshov

11th Jan 2020 @ 10:59

help wanted findapr
  public function bell()
    {
        $this->count += 1;
        flash()->addInfo('Your information has been saved and a confirmation email has been sent.');
    }

This flash message doesn't show up until I reload the page If I reload the page then what's is the point of using livewire

View more
12 comments 👍 1
codebyshami

codebyshami

17th Nov 2023 @ 01:19

bug good first issue

Suddenly today I am getting an error as the package is getting this url back without an extension.

https://fonts.gstatic.com/l/font?kit=XRXI3I6Li01BKofiOc5wtlZ2di8HDLshdTA3iazbXWjgevT5&skey=27bb6aa8eea8a5e7&v=v26

It is a woff file but GoogleFonts::localizeFontUrl() expects it to have an extension and therefor throws a 500 error. It seems to happen quite randomly, and if I run my test suite it happens at least once.

If I check the font files in the storage directory I dont find this url anywhere, so I expect it comes directly from google. Is it perhaps possible to ensure it does not query google in tests at all (even if not preloaded)?

View more
4 comments
sinnbeck

sinnbeck

31st Jan 2024 @ 07:15

findapr

Im using PHPFlasher in a symfony application however it adds session state when not in use. I am combining it with API Platform and my API itself it stateless so it should not hold any session data (causes errors).

How should i handle this (if even possible?)

View more
13 comments
pimjansen

pimjansen

2nd Jun 2023 @ 12:24

help wanted findapr

Hi,

I have an issue in my dockerized Laravel 10 app and flasher 1.15.3. The issue is that notifications are not displayed when I'm using something like this:

    public function customRoute(Request $request): RedirectResponse
    {
        // action
        flash()->addSuccess('Success notification.');

        return redirect()->back();
    }

When I'm redirecting notification won't be displayed, but when directly returning view it works. It behaves like that because of this part of code in your package:

final class StorageBag implements StorageInterface
{
    /**
     * @var BagInterface
     */
    private $bag;

    public function __construct(BagInterface $bag = null)
    {
        $this->bag = null !== $bag && 'cli' !== \PHP_SAPI ? $bag : new ArrayBag();
    }

especially this 'cli' !== \PHP_SAPI because since we are using docker our app is in CLI mode. Can anoyone tell my why this PHP_SAPI check has to be present here?

View more
forexknight

forexknight

13th Sep 2023 @ 05:19

help wanted

Laravel Version

10.43.0

PHP Version

8.3.2 on Docker

Database Driver & Version

No response

Description

I came across a strange behavior of whereNot method in Illuminate\Testing\Fluent\Concern\Matching trait and I cannot understand if it's wanted or not.

I tried to test the emptiness of an array in a response and I used the whereNot method with an AssertableJson object. Therefore I passed to the function an empty array because I seen the implementation and I noticed that on line 73 of Matching trait there is a conversion of $expected var from an Arrayable to an array, so I supposed that the rational behind was to manage array too. But on line 86 the $expected var it's not convert to string for sprintf so php throw an ErrorException: Array to string conversion.

I add an example that throw as I mentioned above in the Steps to reproduce section.

Steps To Reproduce

<?php

use Illuminate\Testing\TestResponse;
use Illuminate\Http\Response;
use Illuminate\Testing\Fluent\AssertableJson;

test('whereNot should not throw an error', function () {
    $response = new TestResponse(new Response('{"data": [1, 2, 3]}'));
    $response->assertJson(function (AssertableJson $json) {
        $json->whereNot('data', []);
    });
});
View more
1 comment
FunkyOz

FunkyOz

10th Feb 2024 @ 22:59

help wanted question

AST, or "abstract syntax tree", creates the expectation of a nested tree structure. In the case of a query string, the AST will only ever be one level deep; as multi nodes are combined into one.

If anyone wants to suggest a better, more clear name: you're welcome.

View more
1 comment
brendt

brendt

20th Dec 2018 @ 13:41

help wanted

Laravel Version

10.43.0

PHP Version

8.2.10

Database Driver & Version

No response

Description

As far as I know it is possible to have working jobs without using the InteractsWithQueue trait but when using the job batching functionality using Bus::batch and Batchable trait this is required for the batch to work properly.

When the InteractsWithQueue trait is not present on the job class the batch will never be considered as finished. I believe this is due to the if statement in the ensureSuccessfulBatchJobIsRecorded method on CallQueuedHandler class which returns early if either the job class does not use the Batchable trait or the InteractsWithQueue trait. I'm not quite sure why this is.

I think one of these solutions should be implemented:

  1. Use the InteractsWithQueue trait in the Batchable trait itself so it is guaranteed that it will work.
  2. If the if statement in ensureSuccessfulBatchJobIsRecorded is somehow not needed it can be removed and then it should work. I am not too sure about this because I couldn't find any uses of the methods available on the InteractsWithQueue trait used in Batchable trait or the Illuminate\Bus\Batch class but I might not have looked in the right places.
  3. Explicitly Mention this requirement in the documentation.

I am interesed in contributing to this issue but not quite sure which of these solutions or any other solution is prefered by the maintainers.

Steps To Reproduce

class SampleBatchableJob implements Illuminate\Contracts\Queue\ShouldQueue
{
    use Illuminate\Bus\Queueable;
    use Illuminate\Foundation\Bus\Dispatchable;
    use Illuminate\Bus\Batchable;
    
    public function handle() {}    
}

Illuminate\Support\Facades\Bus::batch([
    new SampleBatchableJob,
    new SampleBatchableJob
])->dispatch();

// after the jobs are processed `pending_jobs` will remain 2 and `finished_at` will remain null in the `job_batches` table.
View more
1 comment
rahimi-ali

rahimi-ali

12th Feb 2024 @ 17:04

help wanted

When calling mb_convert_encoding() with $fromEncoding === 'HTML-ENTITIES', the polyfill does not return functionally equivalent strings to the native function. This is because mb_convert_encoding() uses html_entity_decode() when $fromEncoding === 'HTML-ENTITIES' and that function does not return characters for many numeric entities 0-31 and 127-159. For example:

<?php

require "vendor/symfony/polyfill-mbstring/Mbstring.php";

use Symfony\Polyfill\Mbstring as p;

for($i = 0; $i < 1024; $i++) {
	$string = "&#" . $i . ";";
	$mbstring = mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
	$polyfill = p\Mbstring::mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
	if($mbstring != $polyfill) {
		echo "Mismatch: $string - mbstring: $mbstring; polyfill: $polyfill\n";
	}
}

outputs:

Mismatch: &#0; - mbstring: ; polyfill: &#0;
Mismatch: &#1; - mbstring: ; polyfill: &#1;
Mismatch: &#2; - mbstring: ; polyfill: &#2;
Mismatch: &#3; - mbstring: ; polyfill: &#3;
Mismatch: &#4; - mbstring: ; polyfill: &#4;
Mismatch: &#5; - mbstring: ; polyfill: &#5;
Mismatch: &#6; - mbstring: ; polyfill: &#6;
Mismatch: &#7; - mbstring: ; polyfill: &#7;
Mismatch: &#8; - mbstring:; polyfill: &#8;
Mismatch: &#11; - mbstring:
                            ; polyfill: &#11;
Mismatch: &#12; - mbstring:
                            ; polyfill: &#12;
Mismatch: &#14; - mbstring: ; polyfill: &#14;
Mismatch: &#15; - mbstring: ; polyfill: &#15;
Mismatch: &#16; - mbstring: ; polyfill: &#16;
Mismatch: &#17; - mbstring: ; polyfill: &#17;
Mismatch: &#18; - mbstring: ; polyfill: &#18;
Mismatch: &#19; - mbstring: ; polyfill: &#19;
Mismatch: &#20; - mbstring: ; polyfill: &#20;
Mismatch: &#21; - mbstring: ; polyfill: &#21;
Mismatch: &#22; - mbstring: ; polyfill: &#22;
Mismatch: &#23; - mbstring: ; polyfill: &#23;
Mismatch: &#24; - mbstring: ; polyfill: &#24;
Mismatch: &#25; - mbstring: ; polyfill: &#25;
Mismatch: &#26; - mbstring: ; polyfill: &#26;
Mismatch: &#27; - mbstring:  polyfill: &#27;
Mismatch: &#28; - mbstring: ; polyfill: &#28;
Mismatch: &#29; - mbstring: ; polyfill: &#29;
Mismatch: &#30; - mbstring: ; polyfill: &#30;
Mismatch: &#31; - mbstring: ; polyfill: &#31;
Mismatch: &#39; - mbstring: '; polyfill: &#39;
Mismatch: &#127; - mbstring: ; polyfill: &#127;
Mismatch: &#128; - mbstring: €; polyfill: &#128;
Mismatch: &#129; - mbstring: ; polyfill: &#129;
Mismatch: &#130; - mbstring: ‚; polyfill: &#130;
Mismatch: &#131; - mbstring: ƒ; polyfill: &#131;
Mismatch: &#132; - mbstring: „; polyfill: &#132;
Mismatch: &#133; - mbstring: …; polyfill: &#133;
Mismatch: &#134; - mbstring: †; polyfill: &#134;
Mismatch: &#135; - mbstring: ‡; polyfill: &#135;
Mismatch: &#136; - mbstring: ˆ; polyfill: &#136;
Mismatch: &#137; - mbstring: ‰; polyfill: &#137;
Mismatch: &#138; - mbstring: Š; polyfill: &#138;
Mismatch: &#139; - mbstring: ‹; polyfill: &#139;
Mismatch: &#140; - mbstring: Œ; polyfill: &#140;
Mismatch: &#141; - mbstring: ; polyfill: &#141;
Mismatch: &#142; - mbstring: Ž; polyfill: &#142;
Mismatch: &#143; - mbstring: ; polyfill: &#143;
Mismatch: &#144; - mbstring: ; polyfill: &#144;
Mismatch: &#145; - mbstring: ‘; polyfill: &#145;
Mismatch: &#146; - mbstring: ’; polyfill: &#146;
Mismatch: &#147; - mbstring: “; polyfill: &#147;
Mismatch: &#148; - mbstring: ”; polyfill: &#148;
Mismatch: &#149; - mbstring: •; polyfill: &#149;
Mismatch: &#150; - mbstring: –; polyfill: &#150;
Mismatch: &#151; - mbstring: —; polyfill: &#151;
Mismatch: &#152; - mbstring: ˜; polyfill: &#152;
Mismatch: &#153; - mbstring: ™; polyfill: &#153;
Mismatch: &#154; - mbstring: š; polyfill: &#154;
Mismatch: &#155; - mbstring: ›; polyfill: &#155;
Mismatch: &#156; - mbstring: œ; polyfill: &#156;
Mismatch: &#157; - mbstring: ; polyfill: &#157;
Mismatch: &#158; - mbstring: ž; polyfill: &#158;
Mismatch: &#159; - mbstring: Ÿ; polyfill: &#159;

While many of these are control characters (and the native function does return them), the single quote (dec 39) is particularly problematic.

View more
1 comment
cpeel

cpeel

18th Mar 2021 @ 04:11

bug help wanted

Laravel Version

10.42.0

PHP Version

8.3.2

Database Driver & Version

Redis 7.2.4

Description

Queued jobs with ShouldBeUnique may cause stale unique locks in the case when the dependent model is missing.

According to the source code of the CallQueuedHandler::call() unique lock cleanup may never be reached in case if the job depends on the missing model AND the job is configured to be deleted when the model is missing (public $deleteWhenMissingModels = true).

Steps To Reproduce

The PoC is made using Redis queue, a similar approach may work with other drivers.

  1. Create a new project: laravel new poc.
  2. Ensure Redis is configured & reachable in your .env file. WARNING: PoC will flush all keys.
  3. Create poc.php file with the following contents:
<?php

use Illuminate\Bus\Queueable;
use Illuminate\Queue\WorkerOptions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Redis;
use Illuminate\Queue\SerializesModels;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldBeUnique;

require 'vendor/autoload.php';
$app = require __DIR__.'/bootstrap/app.php';
$cli = $app->make(Kernel::class);
$cli->bootstrap();

config([
    'database.default' => 'sqlite',
    'queue.default' => 'redis',
    'cache.default' => 'redis',
]);

@unlink(config('database.connections.sqlite.database'));
$cli->call('migrate', ['--force' => true]);

DB::unprepared("
    CREATE TABLE IF NOT EXISTS main (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) UNIQUE
    )
");

DB::unprepared("
    CREATE TABLE IF NOT EXISTS secondary (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) NOT NULL
    )
");

// ensure there are no keys in the DB
Redis::flushdb();

class Main extends Model {
    public $table = 'main';
    public $timestamps = false;
    public $fillable = ['name'];
}

class Secondary extends Model {
    public $table = 'secondary';
    public $timestamps = false;
    public $fillable = ['name'];
}

class MyJob implements ShouldQueue, ShouldBeUnique {
    use Dispatchable, Queueable, SerializesModels;

    public $tries = 1;
    public $maxExceptions = 1;
    public $deleteWhenMissingModels = true;

    public function __construct(
        public Main $main,
        public Secondary $secondary,
    )
    {
    }

    public function handle() {
    }

    public function uniqueId() {
        return 'job-for-' . $this->main->id;
    }
}

// create 2 instances
$main = Main::create(['name' => 'main model']);
$secondary = Secondary::create(['name' => 'secondary model']);

// and schedule a job for them
MyJob::dispatch($main, $secondary);

// delete the secondary model
$secondary->delete();

// run the job
app('queue.worker')->runNextJob('redis', 'default', new WorkerOptions);

echo 'Queue size: ', Queue::size('default'), PHP_EOL; // no tasks left
echo 'Redis contents:', PHP_EOL;
dump(Redis::keys('*')); // unique id is still there
  1. Execute the poc.php php poc.php
  2. Inspect the output to see the stale unique lock

Output

Queue size: 0
Redis contents:
array:1 [
  0 => "laravel_database_laravel_cache_:laravel_unique_job:MyJobjob-for-1"
] // poc.php:95

Expected result

The unique lock has been removed.

Actual result

A stale unique lock still exists.

View more
10 comments
naquad

naquad

29th Jan 2024 @ 11:00

help wanted findapr

I'm using Laravel 10. I've installed the package via "composer require php-flasher/flasher-laravel" Now I'm able to fire flash messages in my controller. I see them in the session data (in flasher::envelopes). But they aren't showing up in my views. In my config file I have 'auto_render' => true. If I put @flasher_render in my blade view, the only thing that's happens is, a notification to warn that this method wil be deprecated.

How can I fix this? I really like to use this package ;-)

View more
3 comments
krisc78

krisc78

9th Mar 2023 @ 14:49

enhancement help wanted

Hi! If I use this package with my project I has a problem. My package.json has a "git dependency" like this:

{
  "peerDependencies": {
    "package": "git+ssh://git@bitbucket.org/team/project.git"
  }
}

And npm-install-peers breaks.

View more
👍 5
JWo1F

JWo1F

18th Dec 2017 @ 08:52

enhancement help wanted

While the BrowserKit package is still maintained, it hasn't bee the default in Laravel for some time. It would be cool to port all the browser kit tests to HTTP tests and remove the laravel/browser-kit-testing dependency.

View more
3 comments
joedixon

joedixon

13th Dec 2023 @ 08:17

bug help wanted

What happened?

After installation, I noticed that in the browser console it outputs an error of wireEl is undefined.

How to reproduce the bug

Just install this package in a livewire project, preferable with Filament's admin package. And see the browser console.

composer create-project laravel/laravel test;
composer require filamentphp/filament;
composer require spatie/laravel-blade-comments;

Then go through the browser console and see the error

Package Version

1.0.1

PHP Version

8.2.0

Laravel Version

10.13.0

Which operating systems does with happen with?

macOS

Notes

Filament ......................................................
Packages ...... filament, forms, notifications, support, tables
Version .............................................. v2.17.44
Views ..................................... PUBLISHED: filament

View more
4 comments 👍 1
sawirricardo

sawirricardo

2nd Jun 2023 @ 07:15

Feature help wanted

Calling for help from Docker experts. We need to create the best possible docker-compose.yml file for this project. The application requirements are well defined (we use env vars, Webpack Encore, PHP 7.1, Symfony 4.1, SQLite database, etc.) so it should be possible to create that file.

View more
30 comments 👍 28
javiereguiluz

javiereguiluz

21st May 2018 @ 09:37

help wanted

Add in PHP 7.3 as Normalizer::normalize() argument for NFKC_Casefold normalization.

View more
1 comment
nicolas-grekas

nicolas-grekas

7th Feb 2019 @ 10:11

enhancement help wanted good first issue

Describe the bug logUnguarded() works provided that $guarded is set explicitly in the model. If it is not set explicitly but globally set, say in AppServiceProvider using Model::unguard(); then nothing is logged.

To Reproduce

  1. remove $fillable and $guarded from a model that use uses LogsActivity
  2. call Model::unguard(); in AppServiceProvider in the boot method
  3. set
    public function getActivitylogOptions() : LogOptions
    {
        return LogOptions::defaults()->logUnguarded();
    }
  1. Make some changes to a model and save them

Expected behavior Some changed properties should be logged but none are

Versions (please complete the following information)

  • PHP: 8.1
  • Database: MySql
  • Laravel: 9.38
  • Package: larvel-activitylog
View more
1 comment
colinmackinlay

colinmackinlay

20th Nov 2022 @ 12:31

enhancement help wanted

For some reason, our test suite is super slow. We should look into this and try to decrease memory usage and speed it up.

Parallel run:

  Tests:    316 passed (785 assertions)
  Duration: 13.64s
  Parallel: 10 processes

Regular run:

  Tests:    316 passed (785 assertions)
  Duration: 96.30s
View more
driesvints

driesvints

29th Dec 2023 @ 10:43

help wanted

Hi,

With the polyfill, var_dump(mb_strlen(chr(254))) return 0. With the php8.0-mbstring extension, var_dump(mb_strlen(chr(254))) return 1;

versions : * v1.26.0

Thanks, Alex

View more
7 comments
alexchuin

alexchuin

18th Oct 2022 @ 12:51