MantisBT - v3.2 Release
View Issue Details
0001466v3.2 ReleaseSystem Adminpublic2014-02-28 03:552014-07-16 21:27
Reporterchristian 
Assigned Tocaseydk 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version3.2Fixed in Version3.2 
Summary0001466: Saving edits/additions on the translation management page result in loss of all information for that module/locale
DescriptionAttempts to add strings through the translation management functionality of the system administration module lead to loss of information - the corresponding files in /locales/[lang] are empty after the user presses the save button.
Steps To ReproduceOpen System Admin -> Translation Management, choose a module with existing keys, and click on the 'Save' button. This will refresh the page with all localisation information for that module/language lost.
Additional InformationThe problem would seem to arise from the use of w2PgetParams() for extracting the array of abbreviations and strings from the post data:

translate_save.php uses $trans = w2PgetParam($_POST, 'trans', array()); to extract information about the keys/values from the post data. However, w2PgetParams in its present incarnation is not capable of dealing with arrays in the post data. This is because this function includes a line that tries to run strip_tags() over the post data associated with a particular key, which in the case that the post data is anything other than a string will fail.

This is evident by the following entries in the server's error log:

strip_tags() expects parameter 1 to be string, array given in ... includes/main_functions.php
Invalid argument supplied for foreach() in ...modules/system/translate_save.php
TagsNo tags attached.
Attached Files

Notes
(0003248)
caseydk   
2014-03-01 18:51   
(Last edited: 2014-03-01 18:52)
This has been resolved in v3.2 development. Here's the relevant patch:
https://github.com/web2project/web2project/commit/3edb12fcff4bb9e10281ae65bd33d206f1f0e81a


Issue History
2014-02-28 03:55christianNew Issue
2014-03-01 18:51caseydkProjectv3.1 Release => v3.2 Release
2014-03-01 18:51caseydkNote Added: 0003248
2014-03-01 18:51caseydkStatusnew => resolved
2014-03-01 18:51caseydkResolutionopen => fixed
2014-03-01 18:51caseydkAssigned To => caseydk
2014-03-01 18:52caseydkNote Edited: 0003248bug_revision_view_page.php?bugnote_id=3248#r2
2014-03-13 22:18caseydkTarget Version => 3.2
2014-07-16 21:26caseydkFixed in Version => 3.2
2014-07-16 21:27caseydkStatusresolved => closed