Welcome Guest, Not a member yet? Register   Sign In
scaffolding_lang.php vars are not being loaded
#1

[eluser]Unknown[/eluser]
Version CodeIgniter_1.5.4.zip
File Scaffolding.php
Line 76

Hi,

I have just tried out the Scaffolding feature and found that the vars in scaffolding_lang.php are not being loaded. This results in Undefined variable notices where the vars are used in the views folder.

Looking at Scaffolding.php it seems the variables should be returned as an array into $this->lang and passed in using load->vars.

Code:
// Load the language file and create variables
$this->lang = $this->CI->load->language('scaffolding', '', TRUE);    

$this->CI->load->vars($this->lang);


This is not the case as the language method in the Loader class excepts two params and returns void.


Code:
/**
     * Loads a language file
     *
     * @access    public
     * @param    array
     * @param    string
     * @param    bool
     * @return    void
     */
    function language($file = array(), $lang = '')
    {            

    }
#2

[eluser]Derek Allard[/eluser]
Ack, darn that was my fault.

Could you try changing
Code:
$this->lang = $this->CI->load->language('scaffolding', '', TRUE);
to
Code:
$this->lang = $this->CI->load->language('scaffolding');
and let me know if that works for you?
#3

[eluser]Derek Allard[/eluser]
OK, forget my last advice. I goofed up when autoloading languages. Grab these 3 new files.

http://dev.ellislab.com/svn/CodeIgniter/...Loader.php
http://dev.ellislab.com/svn/CodeIgniter/...nguage.php
http://dev.ellislab.com/svn/CodeIgniter/...olding.php
#4

[eluser]trahma[/eluser]
i had the same issue, since its my first time using CI on IIS with MSSQL I thought I broke something else. Glad to see it wasn't me Wink
#5

[eluser]Derek Allard[/eluser]
trahma... it should work for you though with a new download correct? The download was patched. Could you grab a new copy and let me know if the problem persists?
#6

[eluser]trahma[/eluser]
i just downloaded the files listed above and after that it worked fine
#7

[eluser]loonatic[/eluser]
I think that I encountered the same bug, but URLs to corrected files seem to be broken... Can anyone upload corrected files somewhere?

I also think that a patch to CI 1.54 should be released, because version I downloaded from the main page still contains many already reported bugs...

Edit: URLs are not broken. It was my ISP's DNS server's fault >:-(

Edit2: But even after I downloaded files the error persists...

Edit3:
I'm not exactly sure, but changing stuffs like this in scaffolding.php:
Code:
'title'    =>  ( ! isset($this->lang['scaff_view'])) ? 'View Data' : $this->lang['scaff_view'],
to:
Code:
'title'    =>  ( $this->CI->lang->line('scaff_view') === FALSE ) ? 'View Data' : $this->CI->lang->line('scaff_view'),
seems to solve the problem with particular language message identifier...

I also checked and noticed that changing things like this in view files:
Code:
$scaff_no_data;
to
Code:
$this->lang->line('scaff_no_data');
also solves the problem with particular language message identifier...

Any solutions? Or maybe I'm doing something not as I should? Please tell me how should I load particular language for scaffolding page?
#8

[eluser]Derek Allard[/eluser]
You can always grab the latest (patched) files from the subversion repository if you want. In addition to any already fixed bugs, you'll get access to many new features.

Here's some quick instructions to get you started.
#9

[eluser]loonatic[/eluser]
I know SVN. I have used it with XT (XHTML Templates).

Anyway newest files don't work for me... The only way to see translated scaffolding is changing files as I shown above... Any suggestions?
#10

[eluser]Derek Allard[/eluser]
Does it work in english?




Theme © iAndrew 2016 - Forum software by © MyBB