I can't manage categories and products on magento - magento

I have problems about Magento.
I can't manage products or category. this just happen I don't know why.
when I click on manage categories it's not working as you can see this image
https://www.dropbox.com/s/zbikd3pfd3b116c/mj1.jpg?dl=0
any solution to resolve?

Hmmmm. What locale are you using? (See drop-down in bottom-left of the screenshot). I wonder if this is a double-byte character issue. I think maybe some JSON has been sent to the page but it has become corrupted possibly due to a double-byte character or some illegal or unescaped character in the JSON string.
If this just happened and you don't know why then:
a) Try some different locales from the drop down. If that doesn't help then:
b) Ensure all caches are cleared and refresh the page. If there is no change then:
c) I suggest you go to your last back up and recreate your website from that.
As mentioned it looks like the HTML of the page is all mixed up due to a malformed JSON string.
You could look at the returned content from the ajax call (using browser tools to study the response). That might give you a clue as to which part of the JSON string is corrupted. Maybe some part of the category attributes contains HTML tags which it shouldn't or there is a double-byte character or unescaped quotes in the JSON string - but that is just a guess. You might have to change your database settings and/or character settings to handle UTF16 characters.
Do all categories behave like that or just some of them? If it is only some of them then you might try deleting those categories and recreating them from scratch.
For the record I have never seen anything like this before.

solution a and b not working, then I re-install and restore sql database by phpmyadmin everything almost complete like before only when I go to Manage Categories then it's error.
There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 682632812035

Related

Magento Translation

I have Magento 1.8.1.0. Recently I've installed Russian pack, the result wasn't appropriate enough, cause some phrases on frontend remained in English
I know there's handy way to translate Magento using cvs-files.
The question is where I can find proper cvs-file? Does installed theme concerns translation some how? I know I'm asking newbie questions, I've read several posts, but I haven't made up my mind how to translate Magento.
Many thanks in advance.
Hope you are doing well,
As i have gone through your question that you want to translate your websites front end in Russian if user has selected the language Russian.
For this you are required to work out the translate.csv files which will be available in your theme Package.
Example : app/design/frontend/default/SecuareWeb/locale/de_DE
In the locale folder you will find the folder for Russian language open that folder and you will find the file where you are required to add the required translation text in it.
How to add translation text in translate.csv file is given below.
Example:
"This is the demo of translation in Russian","Это демо-трансляции на русском языке"
And one thing i would like add is that make sure your front end .phtml files must contain the text in $this->__("Example");. If you have added all the text like this then only then it will allow you for translation other wise it will not translate a text.
Hope this might be use full to you !!!
Waiting for your valuable comments in regards to your Question !!!
There are different ways to achieve translation in Magento so you can find multiple directory containing static csv files and also a database table.
All the modes have same structure: key/value. For example: "String to translate","String translated".
Inline Translation (database table: core_translate):
following best practices in Magento, you should use inline-translation aka database saved translation in rare cases. It is harder to mantain and can be buggy. It has first precedence, so any translation you do via inline translation will override the other 'modes'.
Theme level Translation (file in app/design/frontend/your_package/your_theme/ru_RU/translate.csv):
you can place any string to be translated in the translate.csv. It has second precedence.
Locale translation (file in app/locale/ru_RU/Module_Name.csv):
the suggested way to do translation as it will keep translation separated by each module and is easier to maintain. For example: Mage_Catalog.csv etc.
Each module in Magento can specify its csv file containing translation and sometimes the same string has different modules trying to translate, so if your translation does not work check between multiple file by a quick editor search. It will be overridden by the two above modes.
Note:
Magento will load all the csv files and build up a giant tree and caches it. So before scratching your head because the string is not translated as you wished in the frontend:
1. clean the cache.
2. check for any same key string which comes after your translated string. For example: in the same csv Line 100 will override Line 1 if the key string are the same.
3. check for any same key string in the mode which has higher precedence. For example: inline translation will override any csv based translated string.
It may be easier for you to go to the admin backend System -> Configuration -> Developer and switch "Translate Inline" "Enabled for Frontend" to "Yes".
Then, refresh the frontend and you can change the translation directly at your web browser.
The translation is saved in the database table core_translate just for the case you want to do it in a test environment and copy the translation later on to the production.
Take care that without client restrictions (System -> Configuration -> Developer) everyone will see the translation options.
btw. You may need to clear the cache and refresh the webpage in order to see your changes.

Magento - Mass updating of stock levels fails

I am trying to use following code with latest Magento V1.7.1:
http://www.sonassi.com/knowledge-base/magento-kb/mass-update-stock-levels-in-magento-fast/
I updates stock quantities from CSV file.
It works fine with the following fields:
"sku","qty"
"prod1","11"
However, it does not work, if there are any additional fields.
I tried:
"sku","qty","is_in_stock"
"prod1","11","1"
then qty gets updated, but is_in_stock or any other fields that follow qty are not being imported into the database.
I tried to switch fields and tried the following:
"sku","is_in_stock","qty"
"prod1","1","11"
and now is_in_stock gets updated, but qty does not.
Instruction say to use a minimum of two plus any of additional fields listed, but it does not work.
Would you be able to share updated code?
Thank you.
I don't know the mentioned import extension, but most probably it'll use fgetcsv() calls to read the CSV file, like Magento does.
The fgetcsv() function uses the regular (", Shift+2) double quote as enclosure delimiter by default.
If you really copied the CSV lines 1:1 from your CSV file into this post, containing up to three different enclosure delimiters (“, ” and ") per line, then fgetcsv() has no chance to properly return the field values.
To fix this, just replace all double quotes in your CSV file with the regular one, save and import again.
Remember that depending on your os, the line endings aren't always the same. Windows editors have a nasty habit of adding an extra Carriage Return at the end of each line (learned this the hard way when I wrote a Linux parser for this sort of job in C++). Best check your csv by using something like Notepad++ to see what's at the end of each record.
I'd recommend using Magmi for simple updates such as this. It takes a little effort to set-up (but has very solid documentation to walk you through the process), but once done, is fast, stable and contains a lot of additional plugins that you can use for more functionality than just stock updates in the future.

Magento translation fails

I have trouble translating the phrase "%s was added to your shopping cart." in magento. This is a message that is called in a php-controller (cartController.php).
I use csv-files for the translation and checked them multiple times for errors (missing quotes, wrong quotes, ...), but the translation still won't work. Translating inline seems also impossible as no option is shown to translate success-messages.
I also checked the store language (which is set to Dutch), locale configuration and via code what language he finds, this all turns out fine, everything is okay.
Does anyone know what next steps I should take to investigate this problem or even better: does anyone know a solution for this problem? I found many threads like this one, but unanswered or without an answer for me.
One more thing: Yes, I cleared my cache and translations ;-).
Tx
Try to put translate.csv into your theme folder:
(root)/app/design/frontend/(theme)/default/locale/nl_NL/translate.csv
And put your translation there.
Check the encoding of your file Mage_Checkout.csv
Probably you have ANSI or UTF-8, but it should be "UTF-8 without BOM", otherwise Magento has troubles in using the translation file.

Codeigniter is "catching" url charcters even though they've been urlencoded

I'm having the strangest issue with codeigniter. I have a site that has a search feature which displays the person's query in the url so that they can save the url. I make sure that the query text has gone through rawurlencode before I stick it in the url. However, Codeigniter still shoots me to an error page when there's a character in the query that isn't in my permitted_uri_characters configuration.
So even though my browser says /search-results/query/%22samplequery%22, I’m still getting the error about using non-permitted characters.
Is this a bug? I don’t have non-permitted characters in my url. I have a % sign and some numbers (which are all specifically permitted). It’s definitely the permitted_uri_characters setting that’s giving me grief. If I add a quotation mark to it, it allows the %22 query through no problem.
And to be clear, the query is coming from a form as post data, then being encoded in my controller and then redirected to a new page. There’s no way that the permitted_uri_characters is somehow being applied BEFORE it gets encoded.
This is driving me batty, as my only solution at the moment is to open up my permitted_uri_charcters to everything under the sun, which isn't very secure!
Seems like you'd need to add # to the permitted_uri_chars, even if you urlencode the email before sending it to site_url(). Might urldecode it before watching up the characters ...
Percent Symbol in CodeIgniter URI
Here is a post more specific to your problem.
http://sholsinger.com/archive/2009/04/passing-email-addresses-in-urls-with-codeigniter/
I tried with the permitted_uri_chars, and finally ended up passing the email as a query string (?email=bla#bla.com), not even urlencoding it. Works great :)
Could it be URL encoding the %20 to a " before codeigniter verify' it? How about adding that to the permitted char's list.
I have my own solution for this, it's messy and not optimal, but it works. You can create a table where you store (search_string , url_title).
Every time you perform a search, save the string, generate an url_title() and save it to the database. This way, you can redirect your user to a safe url, without missing the initial search.
I know somebody is gonna yell at me for this solution. But, if your site is small, and your traffic keeps low, it's a valid solution.

URI encoding in Yahoo mail compose link

I have link generating web app. I'd like to make it easy for users to email the links they create to others using gmail, yahoo mail, etc. Yahoo mail has a particular quirk that I need a workaround for.
If you have a Yahoo mail account, please follow this link:
http://compose.mail.yahoo.com/?body=http%3A%2F%2Flocalhost%3A8000%2Fpath%23anchor
Notice that yahoo redirects to a specific mail server (e.g. http://us.mc431.mail.yahoo.com/mc/compose). As it does, it decodes the hex codes. One of them, %23, is a hash symbol which is not legal in a query string parameter value. All info after %23 is lost.
All my links are broken, and just using another character is not an option.
Calling us.mc431.yahoo.com directly works for me, but probably not for all users, depending on their location.
I've tried setting html=true|false, putting the URL in a html tag. Nothing works. Anyone got a reliable workaround for this particular quirk?
Note: any server-based workaround is a non-starter for me. This has to be a link that's just between Yahoo and the end-user.
Thanks
Here is how i do it:
run a window.escape on those chars: & ' " # > < \
run a encodeURIComponent on the full string
it works for most of my case. though newline (\n) is still an issue, but I replace \n with space in my case and it worked fine.
I have been dealing with the same problem the last couple of hours and I found a workaround!
If you double-encode the anchor it will be interpreted correctly by Yahoo. That means change %23 to %2523 (the percent-sign is %25 encoded).
So your URI will be:
http://compose.mail.yahoo.com/?body=http%3A%2F%2Flocalhost%3A8000%2Fpath%2523anchor
The same workaround can be used for ampersand. If you only encode that as %26, then Yahoo will convert that to "&" which will discard the rest of message. Same procedure as above - change %26 to %2526.
I still haven't found a solution to the newline-problem though (%0D and %0A).
For the newline, add the newline as < BR > and double encode it also, it is interpreted successfully as new line in the new message
I think you're at the mercy of what Yahoo's server does when it issues the HTTP redirect. It seems like it should preserve the URL escaping on the redirect, but isn't. However, without knowledge of their underlying application, it's hard to say why it wouldn't. Perhaps, it's just an unintended side effect (or bug), or perhaps some of the Javascript features on that page require them to do some finagling with the hash tag.

Resources