WeBid Bug Tracking

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000576WeBidAdmin Control Panelpublic2016-06-21 09:382016-09-13 16:55
Reporterbigalgeorge 
Assigned Torenlok 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformLinuxOSMintOS VersionDebian
Product Version1.2.0 
Target VersionFixed in Version1.2.1 
Summary0000576: National Flag url for image is broken. (Latest GIThub 1.2.0a)
DescriptionNational Flag url for image is broken.
Hover over image and link is incorrect in lowercase eg /admin/index.php?lan=en
Steps To ReproduceClick language flag link is incorrect in lowercase eg /admin/index.php?lan=en
Additional Informationresults in corrupted language admin panel goes back to messages.php case problem.
TagsNo tags attached.
import_id
Thread
Attached Filespng file icon Selection_002.png [^] (3,852 bytes) 2016-06-21 09:41

- Relationships

-  Notes
(0001434)
bigalgeorge (reporter)
2016-06-26 05:53

There is a case problem in /includes/messages.php ln 41
should be:
$language = strtoupper(preg_replace("/[^a-zA-Z\s]/", '', $_COOKIE['USERLANGUAGE']));
(0001435)
bigalgeorge (reporter)
2016-06-26 05:55

PS how do we add linefeeds into these NOTES??

elseif (isset($_COOKIE['USERLANGUAGE']))
{
$language = strtoupper(preg_replace("/[^a-zA-Z\s]/", '', $_COOKIE['USERLANGUAGE']));
// $language = preg_replace("/[^a-zA-Z\s]/", '', $_COOKIE['USERLANGUAGE']);
}
else
(0001451)
timw255 (reporter)
2016-07-18 23:47

What language are you adding?
(0001452)
timw255 (reporter)
2016-07-18 23:50
edited on: 2016-07-18 23:52

BTW: This is not a bug.

If it doesn't already exist, the flag image added to the /images/flags folder.

Also, it's probably best to leave language folders uppercase.

(0001453)
bigalgeorge (reporter)
2016-07-19 00:05
edited on: 2016-07-19 00:06

Hi the directory for languages is EN
which is what I use. Hence the reason for needing strtoupper( as the case for directory gets lost in code and defaults to incorrect directory name 'en' I guess I may need to add a NZ flag somewhere.

(0001456)
renlok (administrator)
2016-07-19 09:03

Can you add
print_r($LANGUAGES);
to the end of header.php and post what is prints out because I cannot replicate this either
(0001457)
bigalgeorge (reporter)
2016-07-19 09:47

This is an intermittent; what I'll do is temporarily remove the strtoupper( in messages.php until it corrupts again, then try to replicate. Assured, it happens in both localhost and remote, and has been an issue for a few years, possibly to do with rewrite settings. Array ( [EN] => EN ) Going to other issue of broken flag I think the standard en.gif should work for NZ, as language is EN, but the icon is broken. Latest version is not showing flag icon maybe as Ive deleted most of countries.
(0001460)
timw255 (reporter)
2016-07-19 13:33

I tested this again and was not able to reproduce it.

The language identifier in the query string is based on the casing of the language folder. Since this functionality is based on convention, language folders must be in uppercase. (Example: EN, MX, ES, IT)
(0001462)
bigalgeorge (reporter)
2016-07-19 21:20

Hi not disputing language folders case. Problem Ive noticed is in messages.php which returns language string as 'en' instead of 'EN' unless strtoupper() is used.
(0001468)
david62311 (reporter)
2016-08-21 22:05
edited on: 2016-08-23 02:46

I'm verifying this issue here.
It doesn't check first to see if the Language folder exists and will set a cookie to whatever is put up there.. 
The url for English should look like this. /index.php?lan=EN
If you change the EN to en it doesn't match up or it doesn't verify that there is a folder there because it's looking for one with EN instead of en. You end up getting the message array IDs instead of the messages. The cookie sets to whatever two letters is manually typed in there even if the folders don't exist and won't change to a real Language unless it's selected or the browser History gets cleared out.

This should first verify the Language exists and change the url if it needs to to in Capital letters and then use the setcookie once it Verifies the Language folder does exist. 

The adjustment for this should be in the includes/messages.inc.php file.

(0001471)
renlok (administrator)
2016-08-24 10:38

This should fix it https://github.com/renlok/WeBid/commit/12650ec97263ba708c971a6befcf1b48afa98790 [^]
(0001472)
david62311 (reporter)
2016-08-24 16:37

Good job Renlok! This works! 

When I ran my tests:
Anything manually added will defer the Language to the default Language only temporarily.
Like for example say I pick FR for French and I change the FR in the url to fr or ACDC and hit enter.
It will temporarily go to English which is my default Language and then once I click a link,
it goes back to French or whatever Language I have previously selected. This fix works good!

That fixes my problem but, I'm not sure it fixes bigalgeorge's issue.
bigalgeorge give that code in the link Renlok posted and see if that helps and
let us know if it does or not. Maybe we can use strtoupper somewhere if we have to.

Just an additional note to this on other tests I ran.
I renamed the FR folder to fr to see what would happen.
The flag image is broken but, I can still click on it and it will find the fr folder.
The Country folders will have to be in caps or something will have to be done with making the Flag image connect right.

Thanks for fixing this Renlok!

- Issue History
Date Modified Username Field Change
2016-06-21 09:38 bigalgeorge New Issue
2016-06-21 09:41 bigalgeorge File Added: Selection_002.png
2016-06-26 05:53 bigalgeorge Note Added: 0001434
2016-06-26 05:55 bigalgeorge Note Added: 0001435
2016-07-18 23:47 timw255 Note Added: 0001451
2016-07-18 23:50 timw255 Note Added: 0001452
2016-07-18 23:51 timw255 Note Edited: 0001452 View Revisions
2016-07-18 23:52 timw255 Note Edited: 0001452 View Revisions
2016-07-19 00:05 bigalgeorge Note Added: 0001453
2016-07-19 00:06 bigalgeorge Note Edited: 0001453 View Revisions
2016-07-19 08:54 renlok Summary Latest GIThub 1.2.0a => National Flag url for image is broken. (Latest GIThub 1.2.0a)
2016-07-19 09:03 renlok Note Added: 0001456
2016-07-19 09:47 bigalgeorge Note Added: 0001457
2016-07-19 13:33 timw255 Note Added: 0001460
2016-07-19 21:20 bigalgeorge Note Added: 0001462
2016-08-21 22:05 david62311 Note Added: 0001468
2016-08-21 22:20 david62311 Note Edited: 0001468 View Revisions
2016-08-23 02:46 david62311 Note Edited: 0001468 View Revisions
2016-08-24 10:38 renlok Note Added: 0001471
2016-08-24 16:37 david62311 Note Added: 0001472
2016-09-13 16:55 renlok Status new => resolved
2016-09-13 16:55 renlok Fixed in Version => 1.2.1
2016-09-13 16:55 renlok Resolution open => fixed
2016-09-13 16:55 renlok Assigned To => renlok


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker