Bug #4456
felogin XClass prevents customizations of html, _LOCAL_LANG and other XClasses (with patch)
100%
Description
The felogin Xclass is great work, but there are three problems concerning customizability:
- No xclass code included, it's not possible to xclass the t3sec_saltedpw for special customizations - xclass of xclass is not beatuifull, but you got reasons to xclass felogin, we have reasons to xclass your xclass ;-)
- The often used typoscript way to customize locallang text is blocked by the local $LANG object. "plugin.tx_felogin_pi1._LOCAL_LANG.de.xyz = mytext"
- The path and name of the template is statically set within the PHP code, so custom templates can not be set anymore
The locallang.xml was completely copied, there is one key added and two language keys change, so this can be done with setup.txt.
What I did in my patch:- Added xclass code to the file class.ux_tx_felogin_pi1.php
- Moved all custom locallangs into the ext_typoscript_setup.txt (existing)
- Changed all local $LANG->* calls back to regular $this->pi_getLL
- Set the custom html for saltedpw in ext_taposcript_setup.txt
- used $this->conf[ for getting the template path
- tested everything
History
#1
Updated by Jonas Felix over 10 years ago
- File patch-4456.txt View added
#2
Updated by Marcus Krause over 10 years ago
- Category set to XCLASSes
- Status changed from New to Accepted
- Assignee set to Marcus Krause
- Target version set to 0.3.0
Thanks for your (highly appreciated) contribution. I recently got bug reports on exactly this issue via pm. Adressing those guys: say thanks to Jonas.
I'll review and test the patch. If there's no problem with it, this will result in version 0.3.0 to be released today.
#3
Updated by Jonas Felix over 10 years ago
Marcus Krause wrote:
Thanks for your (highly appreciated) contribution. I recently got bug reports on exactly this issue via pm. Adressing those guys: say thanks to Jonas.
I'll review and test the patch. If there's no problem with it, this will result in version 0.3.0 to be released today.
Thank you for taking a look at my patch! You do a great job with t3sec_saltepw.
Are you at the t3con in a week?
#4
Updated by Marcus Krause over 10 years ago
Jonas Dübi wrote:
Marcus Krause wrote:
Thanks for your (highly appreciated) contribution. I recently got bug reports on exactly this issue via pm. Adressing those guys: say thanks to Jonas.
I'll review and test the patch. If there's no problem with it, this will result in version 0.3.0 to be released today.
Thank you for taking a look at my patch! You do a great job with t3sec_saltepw.
Some minor problems:
After all, the felogin xclass is only a XCLASS of sysext:felogin. Therefore I don't want to introduce a new property plugin.tx_felogin_pi1.templateFileSaltedpw like suggested in your patch.
- the XCLASS is going to use the template configured in plugin.tx_felogin_pi1.templateFile
- only if the value is the default EXT:felogin/template.html (which won't work with ext:t3sec_saltedpw), this extension's XCLASS will fallback to the template file, ext:t3sec_saltedpw brings with it (EXT:t3sec_saltedpw/res/tmpl/felogin_template.html)
So please always use plugin.tx_felogin_pi1.templateFile when choosing a custom template!
Furthermore, your translations are not consistent:
e.g.
plugin.tx_felogin_pi1._LOCAL_LANG.en.ll_forgot_message = Please enter either your email address or your username by which you registered your user account...
vs.
plugin.tx_felogin_pi1._LOCAL_LANG.de.ll_forgot_message = Bitte geben Sie die Email Adresse ein, mit der Sie sich registriert haben...
A user is able to use either username or mail address to request a new password.
I'm going to fix that for DE and EN, but due to outdated school french, I will completely remove all the french translations. Feel free to provide an updated translation to cover that issue!
In addition, the mail address should not be exposed by default. Therefore default translation will be
plugin.tx_felogin_pi1._LOCAL_LANG.en.ll_forgot_message_emailSent = Your password has now been sent to the email address of your registered account, if a valid account was found...
However, I'll try to make
plugin.tx_felogin_pi1._LOCAL_LANG.en.ll_forgot_message_emailSent = Your password has now been sent to the email address %s...
also work when you explicitly would like to expose it to the user.
Are you at the t3con in a week?
No, I'm not.
#5
Updated by Marcus Krause over 10 years ago
- File T3X_t3sec_saltedpw-0_2_10-z-200909042155.t3x added
- File 4456-v2.diff View added
- Status changed from Accepted to Needs Feedback
Forget all I've said above! ;-)
I've made a completely new approach.
All the hazzle was about loading ext:t3sec_saltedpw felogin locallang file instead of the default felogin one.
Now, I'm overwriting tslib_pibase::pi_loadLL() with a method that loads ext:t3sec_saltedpw felogin locallang file. Then, I'm able to use standard tslib_pibase::pi_getLL() method.
I've committed according changes to SVN (branch RB-TER-DEV). Additionally, find attached this new extension version and the patch (ext version 0.2.10 as basis).
Please test this new version and send your feedback! In case everything is okay, I'll upload the version to the TER.
#6
Updated by Jonas Felix over 10 years ago
Marcus Krause wrote:
Jonas Dübi wrote:
Marcus Krause wrote:
Thanks for your (highly appreciated) contribution. I recently got bug reports on exactly this issue via pm. Adressing those guys: say thanks to Jonas.
I'll review and test the patch. If there's no problem with it, this will result in version 0.3.0 to be released today.
Thank you for taking a look at my patch! You do a great job with t3sec_saltepw.
Some minor problems:
The single source to be modified should only be the default property plugin.tx_felogin_pi1.templateFile. Therefore, the past and future behavior is like that:
After all, the felogin xclass is only a XCLASS of sysext:felogin. Therefore I don't want to introduce a new property plugin.tx_felogin_pi1.templateFileSaltedpw like suggested in your patch.
- the XCLASS is going to use the template configured in plugin.tx_felogin_pi1.templateFile
- only if the value is the default EXT:felogin/template.html (which won't work with ext:t3sec_saltedpw), this extension's XCLASS will fallback to the template file, ext:t3sec_saltedpw brings with it (EXT:t3sec_saltedpw/res/tmpl/felogin_template.html)
So please always use plugin.tx_felogin_pi1.templateFile when choosing a custom template!
Furthermore, your translations are not consistent:
e.g.
plugin.tx_felogin_pi1._LOCAL_LANG.en.ll_forgot_message = Please enter either your email address or your username by which you registered your user account...
vs.
plugin.tx_felogin_pi1._LOCAL_LANG.de.ll_forgot_message = Bitte geben Sie die Email Adresse ein, mit der Sie sich registriert haben...A user is able to use either username or mail address to request a new password.
I'm going to fix that for DE and EN, but due to outdated school french, I will completely remove all the french translations. Feel free to provide an updated translation to cover that issue!
In addition, the mail address should not be exposed by default. Therefore default translation will be
plugin.tx_felogin_pi1._LOCAL_LANG.en.ll_forgot_message_emailSent = Your password has now been sent to the email address of your registered account, if a valid account was found...However, I'll try to make
plugin.tx_felogin_pi1._LOCAL_LANG.en.ll_forgot_message_emailSent = Your password has now been sent to the email address %s...
also work when you explicitly would like to expose it to the user.Are you at the t3con in a week?
No, I'm not.
This text is taken 1 to 1 from this bloat XML file which was included, I did not change any thing but the way it was integrated into the Extension...
#7
Updated by Jonas Felix over 10 years ago
Marcus Krause wrote:
Forget all I've said above! ;-)
I've made a completely new approach.
All the hazzle was about loading ext:t3sec_saltedpw felogin locallang file instead of the default felogin one.
Now, I'm overwriting tslib_pibase::pi_loadLL() with a method that loads ext:t3sec_saltedpw felogin locallang file. Then, I'm able to use standard tslib_pibase::pi_getLL() method.
I've committed according changes to SVN (branch RB-TER-DEV). Additionally, find attached this new extension version and the patch (ext version 0.2.10 as basis).
Please test this new version and send your feedback! In case everything is okay, I'll upload the version to the TER.
Why don't you just use the "TYPO3 way" of overwrithing locallang texts?
It's working great with using plugin.tx_felogin_pi1._LOCAL_LANG.xy.key = text.
Please take a look at the file: $uxLocallang = 'res/LL/felogin_locallang.xml';, the only things which are different from this locallang file to the original file in the felogin extensions are the three localizations I changed above.
If you make a diff of the res/LL/felogin_locallang.xml to the original locallang you will se that this is totaly useless. There is just one additional key added...
#8
Updated by Marcus Krause over 10 years ago
Jonas Dübi wrote:
Why don't you just use the "TYPO3 way" of overwrithing locallang texts?
I'm repeating myself: Did you test the above attached version? Like already said, this version should allow overwriting locallang texts via TS.
#9
Updated by Jonas Felix over 10 years ago
Marcus Krause wrote:
I'm repeating myself: Did you test the above attached version? Like already said, this version should allow overwriting locallang texts via TS.
Yes I tested it but I don't understand why you need this XML which is a nearly duplicate of the original locallang and has the same translation mistakes as I copied into my typoscript.
I just think it's more complicated and more dangerous solution overwrithing methods not needed to overwrithe and having locallang files not needed...
But thank you very much for working on that, I don't want to be impolite.
#10
Updated by Marcus Krause over 10 years ago
- Due date set to 2009-09-09
- Status changed from Needs Feedback to Resolved
- Target version changed from 0.3.0 to 0.2.11
- % Done changed from 90 to 100
#11
Updated by Marcus Krause over 10 years ago
- Status changed from Resolved to Closed
Issue resolved with extension version 0.2.11
#12
Updated by Jonas Felix over 10 years ago
#13
Updated by Marcus Krause over 10 years ago
Jonas Dübi wrote:
Marcus Krause wrote:
committed to branch RB-TER-DEV with changesets r24028 and r24034
Thanks for fixing it. But why did you keep the locallang file?
By keeping the locallang file in the extension, you'll see what parameters are able to get customized and I don't have to put missing keys (not in default sysext:felogin) or keys that need a different description in TS.