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

Shortcodes not replaced in FulltextSearch results #1751

Closed
g4b0 opened this issue Apr 11, 2013 · 6 comments
Closed

Shortcodes not replaced in FulltextSearch results #1751

g4b0 opened this issue Apr 11, 2013 · 6 comments

Comments

@g4b0
Copy link
Contributor

g4b0 commented Apr 11, 2013

As in subject, search results output is served without replacing shortcodes with corresponding URL (SS 3.1.0-beta2 git pulled right now)

@dhensby
Copy link
Contributor

dhensby commented Apr 13, 2013

@g4b0 hmm, should they be? I have shortcodes to embed YouTube videos, add Google Maps and so on. This kind of media I wouldn't want to show in search results...

Perhaps you should override this on a per site basis?

However, if the ShortCodes still show (aren't stripped out) that is indeed a bug - and one that needs to be decided on how it's fixed (ie: Remove or parse)

@g4b0
Copy link
Contributor Author

g4b0 commented Apr 15, 2013

@dhensby you're right, maybe the correct way to fix the bug is to remove shortcodes in search results rather then parse them. @chillu what do you think about that?

@chillu
Copy link
Member

chillu commented Apr 15, 2013

Its use case dependent, but removing them would be a good default.

@hafriedlander
Copy link
Contributor

I suspect the results are either not being cast as HTMLText, or aren't valid HTML.

If it's the second, you should be able to set ShortcodeParser::$error_behavior to ShortcodeParser::STRIP to have it remove invalid shortcodes, but currently it won't work properly if the HTML can't even be parsed.

@g4b0
Copy link
Contributor Author

g4b0 commented Apr 19, 2013

I tryied with ShortcodeParser::$error_behavior setted to ShortcodeParser::STRIP, but it does not strip external links:

STRIP:

Benvenuto in SilverStripe! Questa è l'homepage di default. Puoi modificare questa pagina aprendo il CMS. Puoi visualizzare adesso la documentazione di sviluppo[http://doc.silverstripe.com], o iniziaren i tutorial.[http://doc.silverstripe.com/doku.php?id=tutorials]

LEAVE:

Benvenuto in SilverStripe! Questa è l'homepage di default. Puoi modificare questa pagina aprendo il CMS[admin/]. Puoi visualizzare adesso la documentazione di sviluppo[http://doc.silverstripe.com], o iniziaren i tutorial.[http://doc.silverstripe.com/doku.php?id=tutorials]

only [admin/] was stripped form my test search

@simonwelsh simonwelsh added the 3.1 label Mar 15, 2014
tractorcow pushed a commit to tractorcow/silverstripe-framework that referenced this issue Jun 15, 2016
tractorcow pushed a commit to tractorcow/silverstripe-framework that referenced this issue Jun 17, 2016
tractorcow pushed a commit to tractorcow/silverstripe-framework that referenced this issue Jun 17, 2016
tractorcow pushed a commit to tractorcow/silverstripe-framework that referenced this issue Jun 17, 2016
tractorcow pushed a commit to tractorcow/silverstripe-framework that referenced this issue Jun 17, 2016
tractorcow pushed a commit to tractorcow/silverstripe-framework that referenced this issue Jul 12, 2016
@tractorcow
Copy link
Contributor

Fixed with #5653 :D

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

6 participants