Closed (works as designed)
Project:
Hierarchical Select
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2010 at 13:39 UTC
Updated:
6 Feb 2011 at 14:19 UTC
I started getting this Fatal error after upgrading to the latest dev version of i18n:
Fatal error: Call to undefined function tt() in /var/www/mysite/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 815
So I've replaced the tt() function with i18nstrings:
// if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
// $options[$term->tid] = tt("taxonomy:term:$term->tid:name", $term->name);
if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
if ($i18nstrings_enabled) {
$options[$term->tid] = i18nstrings("taxonomy:term:$term->tid:name", $term->name);
}
}...and all seems to work fine again. Is tt() being deprecated?
Comments
Comment #1
wim leersI don't know. Let's ask there.
Comment #2
klonoswell... no official answer yet, but Wim, please take a look at this comment here: http://drupal.org/node/358839#comment-2858680 . I think it pretty much answers the question. So, I think it is also pretty fair to bring this back to HS since #358839: Fatal error: Call to undefined function tt() takes care of the issue in i18n queue.
Now, till #358839: Fatal error: Call to undefined function tt() is solved I think you should either warn people not to upgrade to the latest dev version of i18n somewhere in the HS project page, or...
Would you care to update HS code so that every reference to
tt()is replaced withi18nstrings()?? I mean, do you agree with the idea to be ahead of things?If so, does the code in #0 seem ok, or should it be better with a 'graceful' fallback to tt() like so:
I know this is stupid and will make the code of a lot of modules larger. It should be implemented as a fall back within the i18n.module and not as a work-around, but :(
btw... given the large amount of open issues in the i18n.module, I am not sure that #358839: Fatal error: Call to undefined function tt() has been brought to the maintainers' attention (even after legitimately set to 'critical'). If you happen to know any of these guys or can contact them through IRC or something that would be great. I mean, all module maintainers should make some noise about it. What do you think?
Comment #3
klonosupdating the issue's title...
Comment #4
YK85 commented@klonos - could you kindly help create a patch for content taxonomy module which is being affected in the same way? #780976: Replace obsolete functions tt() & to() with i18nstrings() & i18nstrings_update() - WSOD(!)
Comment #5
klonosWell... I am on a limited time schedule, but I believe I can find some time to learn how to create patches and help with all modules facing this issue.
The thing is though that this issue needs to be addressed once we get an official answer from the maintainers of the Internationalization module here: #358839: Fatal error: Call to undefined function tt() .
The tt() function gets called by the majority of modules (at least the ones that support translation of their UI + other strings). This is done a LOT of times within the code and it requires a LOT of changes (actually it is the same change, only repeated several times for each translatable string). So I am guessing that module maintainers might want to do a complete search and replace or something on their code once this is final. If they rush to it, they might bring frustration to people still using older versions of the Internationalization module that still use tt().
For the time being and while we have no official answer, please refrain from upgrading the i18n.module to its latest 2010-Apr-12 dev version (I think 6.x-1.4 stable has the issue as well). The latest version I have working fine with tt() is 6.x-1.x-dev 2010-Apr-08. Please stick to that one and wait a few days.
PS: ...setting tag for issues so we can monitor the progress.
Comment #6
crea commentedTell i18n maintainers to revert it. Why remove supposedly stable API function ? Do they really expect all developers change own code to babysit i18n maintainer fantasies ? This is just rude and stupid.
Comment #7
klonosIt's been dealt with in latest 2010-Apr-30 dev of the i18n module.
Well... at least the tt() function. Now, to() and ts() functions need to follow as it says in the related issue: #358839: Fatal error: Call to undefined function tt() that still remains in 'needs work' state due to this reason.
Also from the dev's changelog:
PS: copy-pasting the above information in other related issues...
Comment #8
klonosI guess it should be done at some point, since tt(), ts() and to() functions are being deprecated. So setting to 'postponed' sounds better. Perhaps at a later major version of the module(?)
Comment #9
wim leersThanks for your efforts! :)
And your suggestion obviously makes sense. However, this is no longer a bug, but a task, thus marking as such :)
Comment #10
wim leersThis won't be fixed. We'll do it the right way in the Drupal 7 port :) See #582484: Hierarchical Select module Drupal 7 port.