Magento 1.7 cannot edit some products - php

I am on Magento ver. 1.7.0.0 and I can't edit some of the products from the admin backend.
When I tried to change the product description directly using mysql it worked, so then I tried removing parts of the description and then found that
everything till the text 'printer driver lets users transfer data' works but when I added the word 'from' to it ,it didn't work making the paragraph end in 'printer driver lets users transfer data from' did nothing ,neither showed a error nor a successful message it just refreshed the page. It can't be about the length because if I replace the text from to krom it works.
So I tried editing the description to just 'printer driver lets users transfer data from' it worked
From the system.log:
ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given in //app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 507
ERR (3): Recoverable >>ERRor: Argument 1 passed to Varien_Object::addData() must be an array, null given, called in //app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 514 and defined in //lib/Varien/Object.php on line 243
ERR (3): Warning: Invalid argument supplied for foreach() in //lib/Varien/Object.php on line 245
The Chrome console tells me :
index.php/admin/catalog_product/validate/id/1/back/edi…roduct_info_tabs_group_7/key/978d8fe4570a41312a7520945e982662/?isAjax=true 500 (Internal Server Error) prototype.js:1530
Ajax.Request.Class.create.request prototype.js:1530
Ajax.Request.addMethods.initialize loader.js:61
(anonymous function) prototype.js:429
klass prototype.js:101
varienForm._validate form.js:80
varienForm.submit form.js:65
saveAndContinueEdit /index.php/admin/catalog_product/edit/id/1/back/edit/tab/product_info_tabs_group_7/key/a325cea2187bfa32cec5c6d0c14e0baa/:2240
onclick
A little PHP debugging tells me that for the product with description error
$product->getAttributes(); was empty but for the working products it was an array.
$attributes = $product->getAttributes();
around line 504 of app\code\core\Mage\Adminhtml\controllers\Catalog\ProductController.php
If I change the following part from the form.js there is no Chrome console error but it still doesn't work:
this.submitUrl = url;
if(this.validator && this.validator.validate()){
if(this.validationUrl){
this._validate();
}
else{
this._submit(); // I removed everything but this
}
return true;
}
If it helps there are 5881 characters before the word 'from' in the description.
I have tried editing in all major browser so there are no compatibility issues.
I believe the problem is somewhere in the javascript but can't find where. Even if I can just remove the validation script from the admin forms I will but I don't think I should and I don't know how.
Any help would be greatly appreciated.
Thanks for your time.

Take a closer look at your .htaccess file. When I migrated my 1.7.0 Magento store to another server I included the .htaccess file from the old server and then the message: "Invalid Form Key. Please refresh the page" popped on screen and nothing happened, not even the configuration changes had effect.
The solution was to install a fresh Magento and then copy the My Store files the the Magento root, excluding .htaccess. When I used the .htaccess from the fresh installation, everything started to work fine. I don't know what exactly happened, maybe each server structure has different and particular .htaccess entries and rules. It works to me.

Related

error: Cannot access offset of type string on string

I'm helping a client with getting their website ready for PHP8. After doing the update to the latest Joomla and making sure the template is updated, it runs fine on PHP8. I do however get the following error only on one page. The page where you have to create a new user:
Error: Failed opening required
'/usr/www/users/kznden/libraries/joomla/document/html/renderer/head.php' (include_path='.:/usr/share/php'): Cannot access offset of type string on string
I know this path doesnt exist anymore but how can I get rid of this error and the page working again? I opened the error.php file and believe the error is related to that file. If I'm wrong, please correct me. Specifically the following code:
$doc->setTitle($this->error->getCode() . ' - '.$this->title);
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
$header_renderer = new JDocumentRendererHead($doc);
$header_contents = $header_renderer->render(null);
Removing
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
doesn't seem to fix the issue.
enter image description here

OpenCart 2.0.1.1 SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK

I know the same problem was posted on StackOverflow before but some of them were for other versions and some just did not work.
Problem: When I try to change the order of status on 2.0.1.1 version of opencart I get =>
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK
Does anyone know the REAL reason behind this issue on version 2.0.1.1 of opencart.
Thank you and a happy new year!
Error Log=>
2017-01-01 12:44:22 - PHP Notice: Use of undefined constant HTTPS_CATALOG - assumed 'HTTPS_CATALOG' in /home/otagmusik.com/httpdocs/admin/controller/sale/order.php on line 1484
2017-01-01 12:44:22 - PHP Notice: Use of undefined constant HTTPS_CATALOG - assumed 'HTTPS_CATALOG' in /home/otagmusik.com/httpdocs/admin/controller/sale/order.php on line 1495
Line 1484 is
if (substr(HTTPS_CATALOG, 0, 5) == 'https') {
Line 1495 is
curl_setopt($curl, CURLOPT_URL, HTTPS_CATALOG . 'index.php?route=api/login');
Change as follows=>
httpdocs/config
// HTTPS
define('HTTPS_SERVER', 'http://www.yoursitename.com/');
httpdocs/admin/config
// HTTPS
define('HTTPS_SERVER', 'http://www.yoursitename.com/admin/');
define('HTTPS_CATALOG', 'http://www.yoursitename.com/');
After you make sure that the http(s) entries match in httpdocs/config and admin/config files try changing the order status. It must change otherwise you may have blocked the interval of the IP address that is used for this interaction. Now for a while remove all blocked IPs from your list in the .htaccess file (copy it somewhere else). Try again. It should do it.
OC 2.0.1.1 runs with PHP 4+. The problem is the MATCH between the to config files in the aforementioned folders and/or the block in the .htaccess file.

Magento Onepage Checkout Doesn't Complete: “Input string was not in a correct format.”

The one page checkout for my store doesn't complete. On the final step (order review), I get this error as a return from the Ajax call to checkout/onepage/saveOrder:
Server was unable to read request. ---> There is an error in the XML document. ---> Input string was not in a correct format.{"success":true,"error":false}
After logging every variable and array I could find in the saveOrderAction method of OnepageController.php, it looks like the redirectUrl from this line is returning nothing:
$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
I haven't found anyone else having this exact problem, and I have a feeling this is being caused by some admin setting that I missed while setting my store up. The production site works fine and I've copied every file onto my local server. Any ideas?

Editing Wordpress category gives PHP line/parse error

Not sure when this occurred but when editing a category, this error is given at the top of the edit category page.
Warning: call_user_func_array() expects parameter 1 to be a valid
callback, function 'my_category_custom_fields' not found or invalid
function name in /home2/sirenon2/public_html/wp-includes/plugin.php on
line 525
Line 525 is call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
When I submit on the edit category page, it gives me the original error plus:
Warning: Cannot modify header information - headers already sent by
(output started at
/home2/sirenon2/public_html/wp-includes/plugin.php:525) in
/home2/sirenon2/public_html/wp-includes/pluggable.php on line 1228
Line 1228 is header("Location: $location", true, $status);.
Any ideas on what the problem is and how to fix it? I do have custom fields on my edit category pages.
Thanks
Either one of installed plugins has error which is throwing above error or you need to update wordpress or PHP. There may be compatibility issue of WordPress with installed PHP version. Few of WordPress's functions might have been updated.
If updating doesn't works, simply go to wp-config.php file and set this constant to false. If this line is not there into config file, add it.
define('WP_DEBUG', false);
I also have this problem before. But I change output_buffering to On. You can find it from PHP.ini.
Or refer this url http://chevronscode.com/index.php/wordpress-header-error-wp-includespluggable-php.html

Modx: Catchable fatal error: Argument 2 passed to modParser::collectElementTags() must be of the type array, null given

Just started with new project and want to try ModX to use it for the project but get stuck on this error (it won't disappear) :
**Catchable fatal error: Argument 2 passed to modParser::collectElementTags() must be of the type array, null given, called in D:\Personal\illumation\modx\core\model\modx\modstaticresource.class.php on line 57 and defined in D:\Personal\illumation\modx\core\model\modx\modparser.class.php on line 101**
It went wrong at the moment I want to try to write a plugin so i created a new plugin in the Manager in an external file called webit-core-plugin.php. Add one event to it and save it. After this, the error described above appear.
Tried to remove it, do it again etc, nothing helps. Does anybody know what is going on?
I use the latest XAMPP, latest SQL/PHP and lastest ModX running on localhost (windows 7) with adminstrator privileges.
Clear Cache folder manually by deleting it through file browser
Open your SQL client, check your elements (templates - *modx_site_templates*, chunks - *modx_site_htmlsnippets*, snippets - *modx_site_snippets*, and plugins - *modx_site_plugins*) that have "static" field = 1, but have "static_file" empty.

Categories