After Migration from Magento 1.9.2.4 to Magento 2.3.4 when I go to create a customer and fill all the information and click on submit(on front-end), it show me error
We can't save the customer.
After debugging I found the error below:
Class Magento\Eav\Model\Attribute\Data\Datetime does not exist
I tried to search the class on the database and also in files, with no results. However, I found something similar in the table eav_attribute:
Magento\Eav\Model\Entity\Attribute\Backend\Datetime
How can I solve it?
Based on the post, “We can't save the customer” error after Migration - Magento 2.3, I did the following:
I searched for Datetime values in eav_attribute.frontend_input.
I found several Mailchimp records with this value.
After I changed the Datetime values to anything else (Date, Text, …), it works again.
edit attribute 'mailchimp_sync_delta' frontend_input datetime to date worked for me.
Related
We have a problem with catalog price rules in 1.9.0
We uploaded 1000 products in a site.
After catalog price rules to give discount for 500 products, there is no date limit for catalog price rules. Those special prices are displaying only until mid-night.
Next day, after mid-night, special prices are not displaying in site.
cron job is working fine.
Please help me to find some solution.
this issue was only solved for me with this:
The problem is in Mage_CatalogRule_Model_Action_Index_Refresh::execute() function. You will have to rewrite this function/class either in your extension, or via the local version of the file.
You have to replace line 121 here :
app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php
$timestamp = $coreDate->gmtTimestamp('Today');
with this line:
$timestamp = Mage::app()->getLocale()->date(null, null, null, true)->get(Zend_Date::TIMESTAMP);
view the original post:
https://magento.stackexchange.com/questions/67970/catalog-price-rules-disappear-after-mid-night
Step 1:
Please make sure that Cron is working fine. For this you can install AOE Scheduler extension.
Step 2:
You need to debug the issue by debugging magento tables. Following tables used for catalog rules:
catalogrule
catalogrule_affected_product
catalogrule_customer_group
catalogrule_group_website
catalogrule_product
catalogrule_product_price
catalogrule_website
You can delete all catalog rules and create one single rule for one product and check following tables:
catalogrule_product - In this table Magento will manage all product discount percent for all customer group.
catalogrule_product_price - In this table Magento will manage discounted final price for each product. Here magento will insert three days record for each record. you can check this by "rule_date" field.
If it is work perfectly. Then Again After deleting all Catalog rules again, Please truncate following tables from MySQL.
catalogrule_product
catalogrule_product_price
As due to many records primary key reach on maximum limit and try again by creating rule for 500 products. hope it will start work.
Hope this help!!
As stated above by #Davi-Reinoldo the problem is with the indexer.
I had this problem as well, the issue exists when there is an offset of the local timezone greater than +01:00.
Basically just because magento is using the gmtTimestamp for the rule date which in the above stated case results in the day before today.
Therefor I developed a small module https://github.com/Chuvisco88/Chuvisco_CatalogRuleFix to fix the issue.
If someone ever has this problem, please give it a try.
I have imported products using System - Import/Export - Import option.
I can see my products in Admin panel, but not in Frontend.
I tried Re-indexing, cache clear, cache refresh, physical cache remove.
also checked product stock status, availability etc. Everything is ok.
But they are not displaying in frontend. I marked onething, If I open product that I imported using csv, just saved without any change, it starts displaying. But I have 100s of products. So I can't use this solution.
So please help me where I am going wrong in csv. below is my csv screenshot.
You need to ensure that the products are attached to a website.
This can be done via a bulk update:
Access the product listm select all
Alter attribute
Products information -> websites
It can also be done in the csv by using a "_product_websites" field and setting it to the website name or 'base'.
I forgot which CSV columns are mandatory but I do remember that if some are missing the importer does not tell you that but instead you get the behaviour that you are describing.
The simplest way to find out what is mandatory is to:
Fix bugs in Magento ImportExport module
Create a new product in admin
Check that the new product is visible on front-end
Export the new product with Magento ImportExport exporter
Delete created product
Import the previously exported product csv
Clear cache and reindex data
Check that product is visible on front-end (it should be)
Compare your CSV with the exported one and try to figure out what is missing from it
Try to import your CSV with added/fixed columns and add data untill the product is imported so that it is visible on front-end
This requires allot of trial and error...
The missing columns in my case had always the same value so if this will be the case with your problem as well you can simply extend CSV importer and hard code those values in there instead of fixing your CSV manually.
Since your product gets saved correctly if you open it in admin and save it you can also:
Import a product
Export that product
Open that product in admin and save it
Export newly saved product
Compare exported CSV-s where they differ
Fixing Magento ImportExport bugs:
First bug is that if you import multiple products the quantity informatino from the first product is used for all the products. To fix this you have to add $row = array(); right before $row['product_id'] = $this->_newSku[$rowData[self::COL_SKU]]['entity_id']; in Mage_ImportExport_Model_Import_Entity_Product::_saveStockItem() function.
The second bug causes Magento ImportExport module to return a foreign key constraint error when importing multiple products. Error happens because magento splits products data into multiple segments and if one product is located in two segments importer will delete data that was imported for the product in first segment before importing the second segment thereby causing database corruption (see this link for detailed explanation - this is where I got the solution below).
Note that removing foreign key constraint will not fix the problem but will instead make it worse since the database will contain corrupt data.
To fix it you have to change the code in Mage_ImportExport_Model_Import_Entity_Abstract::_saveValidatedBunches() function:
After if ($startNewBunch || !$source->valid()) { add
if ($startNewBunch && count($bunchRows) > 1) {
$arrKeys = array_keys($bunchRows);
$arrNew = array();
while(($tRow = array_pop($bunchRows))) {
$tKey = array_pop($arrKeys);
$arrNew[$tKey] = $tRow;
if ($tRow['sku']) {
break;
}
}
$nextRowBackup = array_reverse($arrNew, TRUE) + $nextRowBackup;
}
Hope this helps.
I had the same problem recently and I spent some time tring to figure it out...
Looks like magento needs a status flag for every product otherwise magento will not show it in the dashboard.
Solution : add a "status" column to your CSV file and set all the statuses to "Enabled"
(yes it's not a boolean. Just use the string inside the quotes as it is :)
I was stuck with the same problem, i then visited my var/export/export_all_products file, downloaded it again and uploaded the same back through import, logged out of my account and logged-in back, all products were back. This worked as a backup for me and i could see all the products back at the back-end.
Import as you have. If they are enabled, but not showing...
then you can fix this by clicking "select all" products in the "manage products" table and then "change status" and then select "enabled." This process might take a minute.
Visit your store and you should see your frontend with products.
Some kind of bug with the status/enabled setting.
You must have next fields in CSV
sku
_attribute_set
_type
_category
description
image
name
price
short_description
status
tax_class_id
thumbnail
visibility
weight
qty
_product_websites
is_in_stock
Please note that field is_in_stock is mandatory even if qty more then 1
In magento 2 we need to reindex in index management to display the products in frontend.
We can reindex through cmd.like the given example we need to enter magento file directory after that cmd php -f bin/magento indexer:reindex to reindex .
When I first started importing products via csv although I set the product to enabled, I figured out that even though it shows in the magento back end as enabled, it actually isnt - think its to do with setting the field contents as "1" or "0" rather than "enabled" or "disabled/null".
To get around this, after a import I simply selected all the products in the back end and change status to enabled - it fixes issue.
But, I do think if I simply changed the data in the csv import it would save me this minor in-convenience.
I’m using Magento 1.6.1CE.
I have set the default time zone to Australia/Perth. my server also running in the same time Zone.
when creating the customer there is no issue with created_at column in DB and Customer Since column in admin html.
But when edit the details and Update no problem in saving but Customer Since column is taking some junk date like 30/11/00-1 1:30:00 AM or 01/01/1970 9:30:00 AM. so I’m unable to edit it next time(showing Exception handling is disabled)
when I see in the DB created_at it is showing 0000-00-00 00:00:00.
Please let me know how can I solve this problem. I’m new to Magento Coding.
Thanks in Advance…
I had similar issue once. It's because Magento assumes a specific date format, which depends on your locale.
By default Magento uses format Month/Day/Year. In your case it seems like Magento acutally shifts Day and Month. So, make sure that "Locale" and "Timezone" in System > Configuration > General > Locale Options match.
If they match and you still get this issue, then you will can try to rewrite customer edit block or a controller action.
In Magmi v0.7.17, I can't manage to import configurable products.
Here is an example of the csv I've got (just fields related to problem here):
http://img198.imageshack.us/img198/8871/csvq.jpg
First of all, I need to put "_attribute_set" for the importation to work, otherwise I've got the error “cannot create product sku:xxx no attribute_set defined”. But in every online documentation and in the Dataflow Export this field is "attribute_set".
When I run the importation (using the Configurable Item processor v1.3.6), only the simple products are created and I've got theses errors :
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'attribute_id' cannot be null - INSERT INTO catalog_product_super_attribute(product_id,attribute_id,position) VALUES (?,?,?)
None of the attributes and attributes set exist in database, I want it to be created on the fly. But is it possible ? or do I miss some fields ?
Thanks !
Ok, it works now. After a little debugging in the plugin, I saw that the column "configurable_attributes" was empty. I move it at the beginning of the files (next to attribute_set) and it works fine. It's due to the fact that I didn't encapsulate my text with "" in csv, because Excel doesn't do it. So I modified my file with OpenOffice and let it at the end.
Suddenly attribute_set is working too.
Be sure to select "Magmi Magento Reindexer", otherwise the products won't appear in frontend.
Attributes and attribute sets have to be created in BackOffice before importation. Magmi can just create values of attribute.
What is work for me is:
1. Check "configurable_attributes"
- All attribute are listed ?
- All attribute are correctly spelled?
2. Check same for all custom attribute on header row
3. Check attribute "Use To Create Configurable Product" value is set "Yes"
This Error Means you are having error with attribute and attribute set.
Using Magento 1.6
I had to make some bulk changes to my catlog and so did a full product export, made the changes then imported the ammended file.
Afterwards there were a few index that needed updating, all of them except the "Product Attributes" index correctly.
When I try to re index that one I get the error "There was a problem with reindexing process."
There are no new errors created in var/report and so I have no idea what the problem is.
csv -> http://lazytrek.com/magento_export.csv
edit - As per OSdave's suggestion I got the following error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '84-142-1-58' for key 'PRIMARY'
After struggling for hours I finally found a solution. In fact, It's a very simple solution:
Backup your database
Open phpMyAdmin and truncate (empty) the table catalog_product_flat_1
That's it. After that I was able to index all data and, until now, everything else works perfectly. This worked for me. I hope it works for you too.
PS: using Magento 1.6.0.0
OK I fixed this myself
In the SQL error the first number (in my case 84) indicates the product id, something did not import properly with that ID, I went into the product, saved it manually and hey presto I could re-index.
Hope that helps someone :-)
Remove the lock files in var/locks and try again.
I'd advise you reindex in SSH if you have a large data set
php shell/indexer.php -reindexall
Source :: https://magento.stackexchange.com/questions/24729/there-was-a-problem-with-reindexing-process
I also had this issue and was getting the following in my exception log:
Integrity constraint violation: 1062 Duplicate entry '706-168-2-60' for key 'PRIMARY''
Eventually I discovered (as posted above) that this was a problem with product ID 706 (the first digits before '-' are the product ID.
Simply opening this product within the Magento admin and saving it fixed the issue with this product, however, in my case I also had a problem with product 707, 708, 709, etc, etc...
What I then discovered is the second set of digits identify the attribute ID. I figured out which attribute this was by opening any attribute and replacing it's ID in the URL with the one in the exception log.
I then searched for a series of products (in my case 700 to 800), selected them all and used "Actions" "Update attributes" in the top right of the Catalog - Manage Products page.
I amended this attribute for all of them (which was fine for me) and the indexer worked.
If you can't set this attribute to be the same for all your products I'd suggest a bulk import to reset just this.
Last night, I was having the same problem. After following the steps outlined by OSdave to get the more precise error message, I saw my error was the same as yours.
But it wasn't just with 1 product there were several hundred products causing errors (each one saved brought up a new one). And it wasn't all with the same attribute (I'd updated multiple attributes across a database of over 4,000 products in my last import).
Since everything seemed to actually be in the database correctly (since re-saving seemed to be fixing it and giving the proper data to the final saved product), I had an idea.
Why not export all 4k products, and then re-import the same file without modification and see if that clears it.
It worked!
tl;dr: If you're having this problem with multiple products needing to be re-saved, export your whole inventory (or the relevant section if you can segment in a useful way), and re-import the same file with no modifications.
I'm using Magento v 1.9.0.1
Thanks OSdave,
It's same error for me, I changed this
in Mage_Index_Adminhtml_ProcessController edit line 138, from Mage::helper('index')->__('Cannot initialize the indexer process.') to $e->getMessage():
then tried re-index, it's shows the below error
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8308-2018-1-2788' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_eav_idx (entity_id,attribute_id,store_id,value
then, I remove the product with ID '8308' and recreated and after tried to re-index, it working fine.
But don't the exact root cause of issue. I hope it's help to someone!
Double check the catalog_product_entity,catalog_product_entity_datetime,catalog_product_decimal,catalog_product_int, catalog_product_text,catalog_product_varchar table columns have with respective UNIQUE KEY's.