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

Inserttags from modules are working but logged as "unknown inserttag" #1295

Closed
nomiad opened this issue Jan 9, 2018 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@nomiad
Copy link

nomiad commented Jan 9, 2018

If an inserttag hook is registerd in replaceInsertTags it works, but it logs that there is an unknown insert tag.
it should not be logged as unknown since the module has "defined" it.

Contao Version: 4.4.12 (composer)
PHP: 7.1.9
Problably problem found in vendor\contao\core-bundle\src\Resources\contao\library\Contao\InsertTags.php:959 (break Statement)
Solution: Break out of outer switch statement if inserttag was replaced correctly.

@leofeyer
Copy link
Member

I am using a lot of custom insert tags in my own projects and I cannot reproduce this in any. How does your code look like and what is the exact log message?

@nomiad
Copy link
Author

nomiad commented Jan 17, 2018

Its a small util. you can find the code here:
https://github.com/guavestudios/contao-insertbyalias/blob/master/library/InsertByAlias.php

It is used to reference a module by an alias instead of an db ID

The message is:
INFO09:46:30 | contao | Unknown insert tag: insert_module_alias::changelanguage

@leofeyer
Copy link
Member

How did you register the callback?

@nomiad
Copy link
Author

nomiad commented Jan 18, 2018

it is registered at https://github.com/guavestudios/contao-insertbyalias/blob/14bf13e0a0d71b414437917bdfbab6a28fe871bf/config/config.php#L4

The hook itself works and renders the module.
But the info is still displayed.

Log is written in current tree at:

->log(LogLevel::INFO, 'Unknown insert tag: ' . $strTag)

@leofeyer
Copy link
Member

I have installed your extension and added an insert tag as described:

The insert tag is replaced correctly in the front end:

No "unknown insert tag" log entries have been written.

@leofeyer leofeyer reopened this Feb 12, 2018
@leofeyer leofeyer added bug and removed invalid labels Feb 12, 2018
@leofeyer leofeyer added this to the 4.4.14 milestone Feb 12, 2018
@leofeyer leofeyer self-assigned this Feb 12, 2018
@leofeyer
Copy link
Member

leofeyer commented Feb 12, 2018

Ok, no log entries have been written however the Symfony toolbar revealed them. Fixed in 937c936.

@nomiad
Copy link
Author

nomiad commented Feb 13, 2018

Yeah, i've tried the patch and it solved the the Toolbar Error. Thanks for fixing!

@leofeyer leofeyer modified the milestones: 4.4.14, 4.4 May 14, 2019
leofeyer pushed a commit that referenced this issue Feb 13, 2020
Description
-----------

Fixes #1252

Commits
-------

f75ed427 Handle removed search indexer services
f6dd5f98 Update core-bundle/tests/DependencyInjection/Compiler/CrawlerPassTest.php
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

2 participants