When I try to use the "translate" button for a view, I get the following error message:

PHP Fatal error: Call to undefined function i18n_string_translate_page() in /blah/blah/drupal-7.7/sites/all/modules/i18nviews/i18nviews.pages.inc on line 29

I am using the following (other) modules:

 Package                              Name                                                    Type    Status         Version        
 Chaos tool suite                     Chaos tools (ctools)                                    Module  Enabled        7.x-1.0-beta1  
 Core                                 Block (block)                                           Module  Enabled        7.7            
 Core                                 Contact (contact)                                       Module  Enabled        7.7            
 Core                                 Content translation (translation)                       Module  Enabled        7.7            
 Core                                 Field (field)                                           Module  Enabled        7.7            
 Core                                 Field SQL storage (field_sql_storage)                   Module  Enabled        7.7            
 Core                                 Field UI (field_ui)                                     Module  Enabled        7.7            
 Core                                 File (file)                                             Module  Enabled        7.7            
 Core                                 Filter (filter)                                         Module  Enabled        7.7            
 Core                                 Image (image)                                           Module  Enabled        7.7            
 Core                                 Locale (locale)                                         Module  Enabled        7.7            
 Core                                 Menu (menu)                                             Module  Enabled        7.7            
 Core                                 Node (node)                                             Module  Enabled        7.7            
 Core                                 Options (options)                                       Module  Enabled        7.7            
 Core                                 Overlay (overlay)                                       Module  Enabled        7.7            
 Core                                 Path (path)                                             Module  Enabled        7.7            
 Core                                 Shortcut (shortcut)                                     Module  Enabled        7.7            
 Core                                 System (system)                                         Module  Enabled        7.7            
 Core                                 Taxonomy (taxonomy)                                     Module  Enabled        7.7            
 Core                                 Text (text)                                             Module  Enabled        7.7            
 Core                                 Toolbar (toolbar)                                       Module  Enabled        7.7            
 Core                                 Update manager (update)                                 Module  Enabled        7.7            
 Core                                 User (user)                                             Module  Enabled        7.7            
 Date/Time                            Date (date)                                             Module  Enabled        7.x-2.0-alpha3 
 Date/Time                            Date API (date_api)                                     Module  Enabled        7.x-2.0-alpha3 
 Date/Time                            Date Popup (date_popup)                                 Module  Enabled        7.x-2.0-alpha3 
 Features                             Features (features)                                     Module  Enabled        7.x-1.0-beta3  
 Features                             Portfolio (portfolio)                                   Module  Enabled                       
 Fields                               Link (link)                                             Module  Enabled        7.x-1.0-alpha3 
 Multilingual                         Language icons (languageicons)                          Module  Enabled        7.x-1.0-beta1  
 Multilingual                         Localization update (l10n_update)                       Module  Enabled        7.x-1.0-beta2  
 Multilingual - Internationalization  Block languages (i18n_block)                            Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Contact translation (i18n_contact)                      Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Field translation (i18n_field)                          Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Internationalization (i18n)                             Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Menu translation (i18n_menu)                            Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Multilingual content (i18n_node)                        Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Path translation (i18n_path)                            Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  String translation (i18n_string)                        Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Taxonomy translation (i18n_taxonomy)                    Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Translation sets (i18n_translation)                     Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Variable translation (i18n_variable)                    Module  Enabled        7.x-1.0-rc2    
 Multilingual - Internationalization  Views translation (i18nviews)                           Module  Enabled        7.x-3.x-dev    
 Other                                Variable (variable)                                     Module  Enabled        7.x-1.0        
 Other                                Variable realm (variable_realm)                         Module  Enabled        7.x-1.0        
 Other                                Variable store (variable_store)                         Module  Enabled        7.x-1.0        
 Skinr                                Skinr (skinr)                                           Module  Enabled        7.x-2.x-dev    
 User interface                       Gallery Formatter (galleryformatter)                    Module  Enabled        7.x-1.0        
 Views                                Views (views)                                           Module  Enabled        7.x-3.0-rc1    
 Views                                Views exporter (views_export)                           Module  Not installed  7.x-3.0-beta3  
 Views                                Views Slideshow (views_slideshow)                       Module  Not installed  7.x-3.0-alpha1 
 Views                                Views Slideshow: Cycle (views_slideshow_cycle)          Module  Not installed  7.x-3.0-alpha1 
 Views                                Views UI (views_ui)                                     Module  Enabled        7.x-3.0-rc1    
 Core                                 Bartik (bartik)                                         Theme   Enabled        7.7            
 Core                                 Seven (seven)                                           Theme   Enabled        7.7

Comments

kytom’s picture

Having the exact same problem.

Happened when I updated i18n to 7.x-1.0-rc2, where the function i18n_string_translate_page() got removed.

I tried copying the function from i18n_string.pages.inc from 7.x-1.0-beta8, but it just led to another error:
PHP Fatal error: Call to a member function get_string() on a non-object in /[...]/sites/all/modules/i18n/i18n_string/i18n_string.pages.inc on line 66
which is
check_plain($item_title->get_string()),
in i18n_string_translate_page_overview .

spamator12’s picture

Same here - Fatal error: Call to undefined function i18n_string_translate_page() in drupal\sites\all\modules\i18nviews\i18nviews.pages.inc on line 29

kerios83’s picture

same think here. I guess that Internationalization Views is not compatible with Internationalization module :) I hope it will get fixed soon cause views translation is very important for drupal community.

By the way Internationalization Views work fine with Internationalization beta 7...

there are also more bugs - http://drupal.org/node/1211892 (not related but easy to fix I think:)

miro_dietiker’s picture

Someone please provide a patch for this. i'm a little short in time currently.. but i'll apply it to fix it.

miro_dietiker’s picture

Grr... dup.

gábor hojtsy’s picture

Did some digging. Looks like the old i18n_string_translate_page() went away about a week ago, and similar functionality is now accessible via i18n_string_translate_page_object() in i18n_strings.pages.inc. The changeset was http://drupalcode.org/project/i18n.git/commitdiff/d237936b202b81b2bc78b7...

jhodgdon’s picture

I need to get this working today, so I'm working on a patch... thanks for detective work Gabor - that should help...

jhodgdon’s picture

Oh gracious. It looks like the i18n module has adopted some kind of an object API, and i18n Views hasn't caught up.

jhodgdon’s picture

I did manage to fix this. Will upload a patch in the next day or so when I get the time ... ping me if you need it sooner rather than later....

miro_dietiker’s picture

Would be great. Expect that i can work on this topic next wednesday.

jhodgdon’s picture

StatusFileSize
new16.77 KB

Actually, I didn't manage to make what I would think of as a viable patch. I had to hack i18n_strings and some other things in Views in order to get my views internationalized, and I think the way I did it may not have been compatible with the previous storage for the Views strings. And even with those hacks, I found that i18n_strings would not allow me to localize any field rewrites (in the UI you can rewrite the output of fields), due to this issue:
#1238642: Strings should be able to be runned through filter_xss(_admin)
So I ended up turning off some error checking in i18n_strings completely (hacking, that is).

Anyway, I was under a very tight "we need to launch this site and it needs to be translated" deadline this past week, so I just had to go with expedient rather than correct...

So...all of that said, I imagine that the work I did wouldn't be totally irrelevant for the maintainers of this module, though I wouldn't recommend anyone else use it, so I'm attaching the actual module I ended up with.

kerios83’s picture

@jhodgdon thx for your effort ! I hope it will help miro fix this awesome module.

r13ose’s picture

I tried the new folder that you uploaded and now all my translations are gone for that View, so I had to go back in and change these. The only thing is that now when I try to save these nothing is saving.

Might be just me as I am also getting these errors which appear before I uploaded the new module: Notice: Array to string conversion in drupal_validate_utf8() (line 1359 of /includes/bootstrap.inc).
Warning: preg_match() expects parameter 2 to be string, array given in drupal_validate_utf8() (line 1372 of /includes/bootstrap.inc).

Hope that we can fix this as this is a great module.

jhodgdon’s picture

DO NOT USE what I uploaded!! As I tried to state above, the database storage for translation strings is not backwards compatible with previous versions, and might not be compatible with whatever the maintainers tried to do.

webflo’s picture

Status: Active » Needs review
StatusFileSize
new5.75 KB

Not sure about this. Lets discuss. Is it the right approach?

webflo’s picture

r13ose’s picture

When I applied the first and second patch which I feel are exactly the same. I am getting this error now when I edit Translation Views:

Fatal error: Call to a member function get_string() on a non-object in /sites/all/modules/i18n/i18n_string/i18n_string.pages.inc on line 43

Line 43: check_plain($item_title->get_string()), from my module unless I need to upgrade the i18n module again.

I am also getting this error when I clear the cache: Fatal error: Only variables can be passed by reference in /home/friend72/public_html/sites/all/modules/i18n/i18n.pages.inc on line 31

Line 31: $placeholder = key($info['placeholders']);

miro_dietiker’s picture

Status: Needs review » Needs work

Looks almost great. However still not committed.

Note that still after creation of all views a full views string refresh is needed to make the translations persist on edit.
admin/config/regional/translate/i18n_string

The function process_locale_strings() triggered on each views save (currently triggering save_string) seems not to produce the source objects cleanly. Instead it nicely exports without any warning and - translation saves result in silent drop... Fail!

webflo’s picture

Status: Needs work » Needs review
StatusFileSize
new8.74 KB

Thx miro for your review. I think i found the bug with existing translation (the textgroup is views not view). Refactored a little bit and added translation links to "admin/structure/views".

Please review again.

miro_dietiker’s picture

Status: Needs review » Fixed

I have committed it.
It worked cleanly when testing.

r13ose’s picture

I looked at the commit that you did but I don't see i18nviews.inc and that is missing or is that not suppose to be added in?

miro_dietiker’s picture

ohhh... missed a git add... recommitted. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

webmestre’s picture

Status: Closed (fixed) » Active

Is the new version of the module now patched in order not to give a white page at install ? (novembre 30th 2011)

kerios83’s picture

I have checked the latest version and still get the white page... but after clear the cache the problem is gone. Give it a try.

webmestre’s picture

To kerios83 : when installing the module, for me the "confirm" process fails just after clicking the submit button. How to clear the cache when the whole website is white, no admin, no navigation... ?

kerios83’s picture

@webmestre well it worked for me... If you have an error before any of those steps - copy the module, turn it on, run update.php, clear cache then I don't know what can help you. I have checked it again on clean drupal install, worked like a charm. I have noticed errors only when trying to upgrade previous versions when you have more then 1 language available and some translated content (views).

Maybe one of the maintainer can say more about it.

webmestre’s picture

@kerios83 : thanks for helping !

"views translation" installed when :

1- 4 active languages : OK
2- no translated content : OK
1+2 - OK

Bug and crash seam to occur when translations have been done. Not sure...
It should mean, the module is not to install on working websites, but on a new website. ???

webflo’s picture

Status: Active » Closed (works as designed)

This issue is fixed. Please open a new one with category "support request" or provide more information in #1356654: Module impossible to install

webflo’s picture

changing input format to let me use the pre tag.