created_at column is taking junk date in magento when editing the customer - magento

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.

Related

Customer registration error after Magento migration

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.

Auto Update database column on a certain date

Im making a membership management system using laravel 5.8 for school project
I have a field on my database called "valid_until" which is an expiration date of the membership and "membership_status" which is the status of the membership.
What i want to happen is to update the field "membership_status" automatically when the date now is equal or > to the "valid_until" field.
Is there a way to do it on laravel ?
You should do this with a cron job that will run every day or hour or whatever time frame you want. But you can't compare exact dates, you will probably have to check if now is greater than valid_until field.
Laravel has a nice library for making cron jobs. Check it out:
https://laravel.com/docs/scheduling

Magento Export Issue

We are doing a product CSV custom report. But the system is showing memory issue for a month date range. Is any option to create the same? thanks Rajath

catalog price rules will not work after mid night in magento site

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.

Current version of data in database has changed since user initiated update process

I have a Master Detail form in my Oracle APEX application. When I am trying to update data in this form, I am getting below error.
Current version of data in database has changed since user initiated
update process. current row version identifier =
"26D0923D8A5144D6F483C2B9815D07D3" application row version identifier
= "1749BCD159359424E1EE00AC1C3E3FCB" (Row 1)
I have cleared browser cache and try to update. But it not worked.
How can I solve this?
I have experienced similar problem where my detail records set has timestamp fields. By default master detail wizard creates the timestamp fields as date picker type fields. If you set the date format on these, it would resolve the issue.
This blog post tries to address this issue on a Tabular Form (I know that's not what the original issue was with, but thought it might be related). It says the same as #sangam does below.
Short version: If you have an updated field that's timestamp datatype, you should set a date/time format.
http://apexbyg.blogspot.com/2015/05/tabular-form-bug.html
My tabular form has a field that's timestamp datatype, but I had already set a date format, so this didn't help me.
Here's another possibility, which I discovered was the case in my application.
That would be if the data the original checksum was calculated on is truly different than the pre-update checksum calculation, due to a design-flaw in your query!
In my application, the source for one of the updateable fields was COALESCE(name_calced, name_preferred). In the source table, the person's name could already be loaded in the record by an external process and we save it to one field - name_calced. But the end-user can enter a preferred name, which we wanted to save to the name_preferred field. We wanted to initially populate the displayed, updateable tabular form field with name_calced, if one existed, or name_preferred if the user had already provided a preferred name. Then they could change that value and save it back to the database.
I finally discovered that the Save action threw the error message if name_calced was non-null, but name_preferred was null. I realized that the initial checksum was calculated based on name_calced, but the pre-update checksum was based on name_preferred, so the application thought someone had changed the value in the background and showed the error message.
What I don't understand is how this problem didn't show up in the past 3 years the application has been running in production!
My solution is to make the field source only on name_preferred, which immediately solved this problem. I also think the back-end process will also get changed to pre-populate that table field from name_calced, so the user always sees the base value, if there is one.
I just had this issue myself. Now, I realize that tabular forms are deprecated at this time, but I have an application that was developed beforehand and still uses them. This issue occurred and I had to get one of our big guns at Oracle to help me out. I do a lot of DB work and a decent amount of Apex development but I'm more of a Java, WebLogic, etc guy, and I really couldn't figure this one out.
In my case, it turned out to be really simple. One of the columns in my tabular form was a hidden field, generated via a sub query. Being hidden, this column is not editable by the user and should not be part of the MRU update. I had the field set to "Hidden Column (saves states)" and setting its type to "Hidden Column" fixed the issue. So, this leads to sub queries being executed in such a way as to change the checksum for the overall query before hitting submit (save), causing the error.
For those who are continuing to troubleshoot this, look at your query for every field that you have specified and note which columns are editable in the tabular form. All other fields should be set in a way that makes them not save state so that they are not part of the update.
I had this error when I had two update processes processing on submit.
My solution was to add a condition to both processing steps. I had forgotten to do this when I made an additional process for Button A, but I never updated Button B to limit it's behaviors.
Navigation:
Processing -> Processes -> [Your Process Name] -> Server-side Condition -> When Button Pressed = [Your button Name]
In my case I had a column from a secondary table that was not set as Query Only and was being updated! The error would occur trying to save a column not in the table being updated. It took me half a day to figure it out (the column names were the same).
Set your Link column hidden to display only in the form.
Set "Send On Page Submit" to 'No' or disable the link column that is your primary key ( Rownum/rowid/id etc).
Hope it will work for you.
I have noticed this error comes when I was working Tabular Form and has disabled one of the form operations i.e. by setting server-side condition to "Never" for add, apply changes (submit) buttons
When I have restored back to its original state, it worked as expected.
In case you have to hide Add/Update button, use some other option.
https://compknowledgebase.blogspot.com/2018/12/oracle-apex-error-current-version-of.html

Resources