cubicweb.pyramid.core.connection session._cached_lang is not synchronised with request
Bug description: translation made in pview might have the wrong language
Steps to reproduce:
- have a language set in the user preference, e.g. english
- visit a webpage displaying information in a pview with translated text.
- the text is correctly translated
- go to
/view?vid=propertiesform
and change in theui
sectionlanguage of the user interface
to another language, e.g. french. - hard refresh the page from step 2.
- The text from the preview is still in english the rest is correctly translated
This occurs if the pview use request.cw_cnx
(which returns a Connection) instead of request.cw_request
(which returns a CubicWebPyramidRequest)
Possible solution: removing self.lang = session._cached_lang
from Connection constructor solved the problem.
This lines has been introduced in: d7ecf6dab085