Post by guntis.e » Sun Nov 27, 2011 7:41 pm

Undefined variable: attribute when adding new language.

To recreate the problem:
  • Clean install.
  • Delete all products and product attributes.
  • Add new language. Fill in needed info and press save.
The following error appears:

Code: Select all

Notice: Undefined variable: attribute in /home/xxx/public_html/xxx/admin/model/localisation/language.php on line 23Notice: Undefined variable: attribute in/home/xxx/public_html/xxx/admin/model/localisation/language.php on line 23Notice: Undefined variable: attribute in /home/xxx/public_html/xxx/admin/model/localisation/language.php on line23Notice: Undefined variable: attribute in /home/xxx/public_html/kidap/admin/model/localisation/language.php on line 23Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/xxx/admin/index.php:79) in /home/xxx/public_html/xxx/system/engine/controller.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/xxx/admin/index.php:79) in /home/xxx/public_html/xxx/system/engine/controller.php on line 29
After going back to languages i can see that the language is created. When opening it again and saving there is no more this error.

If there is at least one attribute defined, i do not get the error message, when adding a new language.
Last edited by i2Paq on Sun Nov 27, 2011 10:22 pm, edited 1 time in total.
Reason: Split, renamed

Guntis
Image Partneris.lv - opencart web site development and support


Active Member

Posts

Joined
Fri Jan 28, 2011 4:20 am

Post by i2Paq » Sun Nov 27, 2011 10:24 pm

The error to look at is "headers already sent".

Please use our FREE search on: headers already sent <--(click me)

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Daniel » Sun Nov 27, 2011 10:57 pm

if you have delete3d all product attributes you should go to your phpmyadmin manager and manually empty the attribute table. looks like there might be some redundant data.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Daniel » Sun Nov 27, 2011 10:59 pm

check the svn i just fixed it.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by matts118 » Mon Dec 12, 2011 2:50 am

What does check the SVN mean, can you please explain how to fix, I am having this problem and run version 1.5.1.3.

Many Thanks

Newbie

Posts

Joined
Mon Dec 12, 2011 2:41 am

Post by straightlight » Mon Dec 12, 2011 5:17 am

The reason you're seeing this error is because an attribute may or may not be guaranteed while adding a language in this case. The error message shows up because the cache can't find the 'attribute' key.

A temporary solution would be to state from admin/model/localisation/language.php file

for each instances of:

Code: Select all

$this->cache->delete('attribute');
replace them all with:

Code: Select all

if (!empty($this->cache->get('attribute')) {
    $this->cache->delete('attribute');
}
This should correct this particular problem.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Daniel » Mon Dec 12, 2011 10:11 am

the problem was something was mispelled

a var should have been called attribute_group not attribute.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 48 guests