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

Ai powered solution sends an error #4

Open
bestmomo opened this issue Jul 21, 2024 · 2 comments
Open

Ai powered solution sends an error #4

bestmomo opened this issue Jul 21, 2024 · 2 comments
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@bestmomo
Copy link

What happened?

I just installed package and complement for AI powered solution. When I create an issue to test it I get :

Capture d'écran 2024-07-21 125216

I had to change the links function like this to make it work for me:

public function links(): array
{
    $rawText = Str::finish($this->rawText, 'ENDLINKS');

    $textLinks = $this->between('LINKS', 'ENDLINKS', $rawText);

    $textLinks = explode(PHP_EOL, $textLinks);

    $links = [];

    foreach ($textLinks as $textLink) {
        $textLink = str_replace('\\', '\\\\', $textLink);
        $textLink = str_replace('\\\\\\', '\\\\', $textLink);

        $decodedLink = json_decode($textLink, true);

        if ($decodedLink !== null) {
            $links[$decodedLink['title']] = $decodedLink['url'];
        }
    }

    return $links;
}

How to reproduce the bug

When I install the package in my project and use it with AI powered

Package Version

1.0

PHP Version

8.2.14

Laravel Version

11.14

Which operating systems does with happen with?

Windows

Notes

No response

@bestmomo bestmomo added the bug Something isn't working label Jul 21, 2024
@freekmurze freekmurze added enhancement New feature or request good first issue Good for newcomers labels Jul 22, 2024
@freekmurze
Copy link
Member

I'd accept a PR that fixes this.

@SecurID
Copy link

SecurID commented Aug 13, 2024

Isn't that already resolved by spatie/error-solutions#9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants