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

Document saving failed #1498

Closed
albertmueller opened this issue Oct 8, 2020 · 7 comments
Closed

Document saving failed #1498

albertmueller opened this issue Oct 8, 2020 · 7 comments
Assignees
Labels
Milestone

Comments

@albertmueller
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes/no

If i try to save a document, sometimes i got this error:
image

It comes from:

abstract class AbstractSluggableLinkGenerator implements LinkGeneratorInterface
{
    protected function slugify($string): string
    {
        return strtolower(
            trim(
                preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(
                    preg_replace(
                        '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i',
                        '$1',
                        htmlentities($string, ENT_QUOTES, 'UTF-8')
                    ),
                    ENT_QUOTES,
                    'UTF-8'
                )),
                '-'
            )
        );
    }
}
@alex-jungwirth
Copy link

Hi. Same error here. When returning a random string from slugify method, the stuff works. Don't know why, but could you please fix this? Pretty please <3

@dpfaffenbauer
Copy link
Member

Guess you use link-generators for objects that don't have a name?

@albertmueller
Copy link
Contributor Author

that's happen also on documents, without use of objects. "fixed" it local with a return of a empty string if $string is null

@dpfaffenbauer
Copy link
Member

It happens with documents cause of the validation check where Pimcore renders the documents thus triggering the link generator

@albertmueller
Copy link
Contributor Author

but can we return a empty string if $string is null? otherwise it is a bit confusing if you don't know whats going on. if you agree i can do a PR?

@dpfaffenbauer
Copy link
Member

yes, I guess that would be a solution

@dpfaffenbauer
Copy link
Member

that has been fixed

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

No branches or pull requests

3 participants