National Flags

Errors on all pages - National Flags

Errors on all pages

by igorbond » Wed Oct 11, 2017 4:41 pm

With included debug there are such errors. For each flag by mistake

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/ext/rmcgirr83/nationalflags/core/nationalflags.php on line 112: Undefined variable: flags_array 
[phpBB Debug] PHP Notice: in file [ROOT]/ext/rmcgirr83/nationalflags/core/nationalflags.php on line 112: Undefined variable: flags_array 
[phpBB Debug] PHP Notice: in file [ROOT]/ext/rmcgirr83/nationalflags/core/nationalflags.php on line 112: Undefined variable: flags_array 
[phpBB Debug] PHP Notice: in file [ROOT]/ext/rmcgirr83/nationalflags/core/nationalflags.php on line 112: Undefined variable: flags_array 
[phpBB Debug] PHP Notice: in file 
Image
igorbond
Registered User
Posts: 104
Joined: Sun Mar 24, 2013 5:54 pm
Contact:

Re: Errors on all pages

by RMcGirr83 » Wed Oct 11, 2017 5:24 pm

Change that line to this

Code: Select all

$flag_name = isset($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) ? html_entity_decode($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) : html_entity_decode($flags[$flag_id]['flag_name']);
It is due to you using a lang other than en and you haven't translated the lang file from the extension.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Errors on all pages

by Galixte de EzCom » Tue Mar 06, 2018 8:09 am

RMcGirr83 wrote:Change that line to this

Code: Select all

$flag_name = isset($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) ? html_entity_decode($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) : html_entity_decode($flags[$flag_id]['flag_name']);
It is due to you using a lang other than en and you haven't translated the lang file from the extension.
Hi RMcGirr83,

I’m testing your 2.1.4 version downloaded from phpBB.com on a phpBB vanilla 3.2.2 board using with an additional language (FRENCH) installed for phpBB and for your extension.

This error message appears on index, viewforum, viewtopic & memberlist (viewprofile) pages when I use an additional flag (custom):

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/ext/rmcgirr83/nationalflags/core/nationalflags.php on line 112: Undefined variable: flags_array
To fix this, I have to edit the FRENCH language file: ./ext/rmcgirr83/nationalflags/language/fr/common.php and ADD a new line corresponding with the name of the new a flag added, for example like this: 'BRETAGNE' => 'Bretagne',.

Why a way so complicated to resolve this problem?
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.
Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.
User avatar
Galixte de EzCom
Registered User
Posts: 1037
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Re: Errors on all pages

by RMcGirr83 » Tue Mar 06, 2018 10:07 am

This line in the file

Code: Select all

$flag_name = isset($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) ? html_entity_decode($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) : html_entity_decode($flags_array[$flag_id]['flag_name']);
is incorrect and should be

Code: Select all

$flag_name = isset($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) ? html_entity_decode($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) : html_entity_decode($flags[$flag_id]['flag_name']);
this is fixed in the next version awaiting validation.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Errors on all pages

by BrainiAC » Mon May 21, 2018 11:07 pm

RMcGirr83 wrote:This line in the file

Code: Select all

$flag_name = isset($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) ? html_entity_decode($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) : html_entity_decode($flags_array[$flag_id]['flag_name']);
is incorrect and should be

Code: Select all

$flag_name = isset($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) ? html_entity_decode($this->user->lang[strtoupper(str_replace(" ", "_", $flags[$flag_id]['flag_name']))]) : html_entity_decode($flags[$flag_id]['flag_name']);
this is fixed in the next version awaiting validation.
Hi!

The trouble was fixed?

I did install the update 2.1.6 and i'm using the Portuguese translate update to [ver 2.1.6], but the language on some fields was changed to english:
Image
Image.

Thanks.
Sorry about my english (isn't my native language), so i'm not a fluente yet :).
User avatar
BrainiAC
Registered User
Posts: 25
Joined: Fri May 11, 2018 12:11 am
Contact:

Re: Errors on all pages

by Galixte de EzCom » Mon May 21, 2018 11:59 pm

Yes HAL 9000, I encountered the same situation some weeks ago, I forgotten to report it, sorry.
RMcGirr83 wrote:
Maybe it the same “bug” like this: viewtopic.php?p=14801406#p14801406 (for Topic Title Color) where DavidIQ had indicated this: viewtopic.php?p=14801626#p14801626 | He fixed this issue here: https://github.com/DavidIQ/topictitlecolor/issues/6.

The same case for phBB Gallery where Kasimi had answered this: https://www.phpbb.com/customise/db/exte ... 91#p580491.

It seems not a core bug but there are missing informations in Wiki for extension developers, a ticket on tracker was opened too: https://tracker.phpbb.com/browse/PHPBB3-15315.
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.
Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.
User avatar
Galixte de EzCom
Registered User
Posts: 1037
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact: