Anonymous Login
2023-06-05 09:53 PDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001466v3.2 ReleaseSystem Adminpublic2014-07-16 21:27
Reporterchristian 
Assigned Tocaseydk 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
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

-Relationships
+Relationships

-Notes

~0003248

caseydk (administrator)

Last edited: 2014-03-01 18:52

View 2 revisions

This has been resolved in v3.2 development. Here's the relevant patch:
https://github.com/web2project/web2project/commit/3edb12fcff4bb9e10281ae65bd33d206f1f0e81a

+Notes

-Issue History
Date Modified Username Field Change
2014-02-28 03:55 christian New Issue
2014-03-01 18:51 caseydk Project v3.1 Release => v3.2 Release
2014-03-01 18:51 caseydk Note Added: 0003248
2014-03-01 18:51 caseydk Status new => resolved
2014-03-01 18:51 caseydk Resolution open => fixed
2014-03-01 18:51 caseydk Assigned To => caseydk
2014-03-01 18:52 caseydk Note Edited: 0003248 View Revisions
2014-03-13 22:18 caseydk Target Version => 3.2
2014-07-16 21:26 caseydk Fixed in Version => 3.2
2014-07-16 21:27 caseydk Status resolved => closed
+Issue History