Magento Can't mass update attributes for Required Field Error - magento

I’m hoping someone can shed some light on this:
I’m using the search facility in Magento to find products with a certain attribute, and then selecting those products and using the “update attributes” feature to add data to (update) a different attribute field.
In some cases, this works fine, the new attribute data is recorded and all is well. On other selections when I try and save the new attribute data it comes up with the red warning “this is a required field”. Sure enough, the field it specifies IS a required field, but as I’m not updating that particular field I’ve not ticked the check box underneath it and this field should be ignored.
If I turn off the “required field” option for the highlighted fields then the new attribute data gets saved BUT: It wipes the data in loads of the other attributes, meaning I lose valuable data from my product attributes. It seems as if it works the first couple of times I use it in a day then it spits its dummy out and comes up with the required field issue.
I’ve tried this with both Google Chrome and Firefox. As I’ve said though, sometimes it will work , sometimes it won’t . I’m selecting 20-100 products at a time. I’ve even tried selecting just one product, and can still get the same error on that one product.
I’m on Magento 1.7.0.2
I did have a similar problem with attribute data getting wiped last year when we were on 1.6 but I seem to remember it was a Magento bug which was fixed when we upgraded to a newer version.
Can anyone shed any light on why this might be happening? There’s nothing coming up in the search engines for it and its really slowing me down!

The problem is that the attributes are NOT getting disabled by default in the update attributes page, hence require a value.
Why?
Most likely due to a faulty attribute failing somewhere above your attribute.
Option 1. As I don't know what attribute or the attribute problem, hack js/mage/adminhtml/product.js and change this function to ignore the faulty attribute.
function disableFieldEditMode(fieldContainer) {
try {
$(fieldContainer).disabled = true;
if ($(fieldContainer + '_hidden')) {
$(fieldContainer + '_hidden').disabled = true;
}
}
catch(exception) {
}
}
Option 2. Remove the faulty attribute from the product (You might need to remove restrictions ).
update eav_attribute set is_user_defined = 1 where attribute_code like 'foo_bar';
Option 3. Fix the faulty attribute. In my case the offending module was AW_Onsale.
it attempted to render a nonexistent frontend model: onsale/system_entity_form_element_position
select attribute_code, frontend_model from eav_attribute where attribute_code like '%aw_os_%';
aw_os_product_position | onsale/entity_attribute_frontend_position
update eav_attribute set frontend_model = null where attribute_code like '%aw_os_product_position%';
update eav_attribute set frontend_model = null where attribute_code like '%aw_os_category_position%';

Related

adding row manualy into DataGrid using VB6

i want to display the data into DataGrid manually in VB6, source of data is not from database or other source. I have created the column, like this:
For i = 2 To 4
DataGrid1.Columns.Add i
Next i
DataGrid1.Columns(0).Caption = "No"
DataGrid1.Columns(1).Caption = "Subdataset"
DataGrid1.Columns(2).Caption = "Dimension"
DataGrid1.Columns(3).Caption = "Check"
DataGrid1.Columns(3).Caption = "Detail"
but i can't add row and add value into it, i have tried like this:
Me.DataGrid1.AllowUserToAddRows = True
DataGrid1.Row = DataGrid1.Row + 1
then i got error
Please tell me if anybody can help me, thank you
Not only is DataGrid designed to be a bound control, it doesn't support unbound use. Says so right in the doc. So, the short answer is that you can't do what you are trying to do, because it's designed to display values from a database.
Instead, you'll want to use the MSFlexGrid control (Not the MSHFlexGrid control, although some of the doc confuses them), which you can read about here. Suppose you play around with that (the AddItem method is the fundamental piece you need to work with) and post back with specifics if you have problems.
Once you have added the table (DataGrid) right click select edit then you can insert columns:

Handsontable Dynamically Set Settings

I have a very big handsontable. I have dropdown columns defined, but, the values for the sources are retrieved with AJAX.
How can I set the "source" property of a "column" of type "dropdown" dynamically?
Regards!
You can, and should, use:
hotInstance.updateSettings({
columns: getNewColumns()
})
Where getNewColumns() would return an array of columns with the data and new source (or make the AJAX call from in here). That should do it!
Thank you for the answer ZekeDroid.
I was able to solve my issue.
First lets talk about a problem in the angular directive:
I am using the handsontable's angular directive. Two things happen: 1. If I associated the datarows attribute to a nested variale in the model, for example $scope.hot.data, then when I change the value of the model ( $scope.hot.data ) the grid ui is not refreshed. I am pretty sure this is an issue with the directive. Now: 2. Assume I use $scope.data and I update its value (this is the model right), then the grid ui is not refreshed either. I have to do something like hotInstance.updateSettings({data: newData}) as well.
I have to do both things; that is, update the model and call the update settings method. This is the only way I could get it work properly.
Note: if I do $scope.$apply() instead the updateSettings, I get an error in the console.

Prototype.js can't save attribute in magento

I have this problem with Magento 1.7, I can't save attributes, the button turns gray and nothing happens.
In firebug, I get this error message
TypeError: value.gsub is not a function
value = value.gsub(/(\r)?\n/, '\r\n');
in prototype.js on line 5809
It looks like you are trying to serialize the elements in a form and one or more of the elements do not have a value attribute to read.
2 ways to fix - either check all your form elements and make sure they have a value='' attribute at the minimum.
OR
you can update the prototype.js file with some of the latest updates which has added checks to make sure the a value attribute exists before trying to act on it.
https://github.com/jwestbrook/prototype/tree/master-w-updates/dist

JavaFX TableView content disappears on scrolling

I managed to create a TableView with specific columns assigned to a datamodel-class. The program can parse a csv file into it and shows everything correctly in the table. Scrolling isnt a problem at this stage.
Then I want to select specific rows and send them to another table. Which works as well. But when I start scrolling in table1 again the content outside the visual area is disappeared.
I dont really understand what happened here because I didn't changed anything for table1. Both lists are using Order as datamodel... perhaps this is a problem? Here is the code which sends the rows to table2:
if(init) { //init is true
ObservableList<TableColumn<Order, ?>> header = table1.getColumns();
table2.getColumns().addAll(header);
table2.setItems(table2Observable);
init = false;
}
table2Observable.addAll(table1.getSelectionModel().getSelectedItems());
table2.setItems(table2Observable);
if order is your bean class then override the hashcode() and equals() method properly. This is occurring because of the duplicate object. It worked for me.

bundle product shows price as 0

I've been reading a lot about this problem but I get nothing that suggests a way out.
I am working with version 1.3.2.4 and after creating a bundle product, Magento displays it as price as zero, but gives the "current composition" as the correct value.
alt text http://www.balexandre.com/temp/2009-10-13_2158.png
I already tried to refresh the cache, rebuild the catalog index, and nothing works...
Then I went deep and navigated into the price.phtml template under
template/bundle/catalog/product/view/
and tried to invoke the same method that is showing correctly the value, bu that as well, return zero.
I did notice that Magento has this javascript method
bundle.reloadPrice();
right after and if invoked I do get the correct price... I can try, using jQuery (or Prototype as Magento uses by default) change the value, but I was trying to this right...
Any other ideas?
Had the same problem.
price showed as 0.00.
you have to edit your price-attribute -> show in product-listing: yes
for the product page I'm using this as a work around:
executing this jQuery code:
// hide "Price as configured" text
jQuery(".price-as-configured span:first").hide();
// hide the 0,00 price
jQuery(".price-box-bundle").hide();
// hide the 2nd price (not in image)
jQuery(".product-options-bottom .price-box").hide();
will pass this:
alt text http://www.balexandre.com/temp/2009-10-13_2338.png
into this:
alt text http://www.balexandre.com/temp/2009-10-13_2339.png
In the product grid list I'm using this code to hide the price/button and add to wish list links
// GRID
jQuery("#products-grid-table .price-box").hide();
jQuery("#products-grid-table .button").hide();
jQuery("#products-grid-table .add-to-links").hide();
// LIST
jQuery("#products-list .price-box").hide();
jQuery("#products-list .button").hide();
jQuery("#products-list .add-to-links").hide();
and it will pass this
alt text http://www.balexandre.com/temp/2009-10-14_0005.png
into this
alt text http://www.balexandre.com/temp/2009-10-14_0006.png
I hope it helps someone ...
you can use my magento module: https://github.com/head82/KH_ExtendedBundlePrice tested with magento 1.7

Resources