Can't save models to DynamoDB using Swift 4 - amazon-web-services

I started a new project using XCode9 and Swift4. I copied the basic example code for saving models to DynamoDB but I keep getting the following error:
Amazon DynamoDB Save Error: Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain Code=0 "(null)" UserInfo={__type=com.amazon.coral.validate#ValidationException, message=Supplied AttributeValue is empty, must contain exactly one of the supported datatypes}
My project only contains the example code provided and nothing else, how can I get my models to save?

The work-around until Swift 4 is supported properly is to put
#objcMembers
before the class declaration for your model class, as described in this bug report.
https://github.com/aws/aws-sdk-ios/issues/750
This fixed the issue for me without having to downgrade to Swift 3.

DynamoDB doesn't seem to support Swift4 yet. I downloaded the sample project provided by AWS (MySampleApp) and set the target's build settings Swift Language Version to Swift 4.0, made slight modifications so it would compile, and I got the same error.
Reducing the Swift Language Version to Swift 3.2 in both the sample app and my own project fixed the problem.

Related

Does uninstalling Custom Module Builder Extension affects the custom created modules

We are using vTiger CRM with its Extension Pack from VTExpers, Inc.
We used the Custom Module Builder Extension to Custom Modules Several times, now we want to Uinstall the extension.
My Question is:
What will happen to the Custom Created Modules, which have been created through this Extension, will they disappear as well, or they will remain Active in the CRM?
I want to keep the Custom Modules and remove (uninstall) the Extension it self.
They remain in your crm but your custom modules will not work after uninstalling Custom Module Builder
Simply modify YourCustomModuleName_Module_Model class and remove isActive method from class. you can find this class in the following path:
modules/YourCustomModuleName/models/Module.php
yes, created modules will be there
The modules will be there, beware as VT Experts uses ION Cube to encrypt most of their extensions so you have no idea what the code is doing.

ActiveModel::MissingAttributeError (can't write unknown attribute `price_cents`): error after rails upgrading to rail 5.1

I have upgraded my rails app which was earlier on rails 4.1 to rails 5.1.
Now I am getting an error while using acts_as_shopping_cart gem, which is on version 0.4.1
I tried many things but not sure why exactly I am getting this error, while adding item to cart
ActiveModel::MissingAttributeError (can't write unknown attribute price_cents):
app/models/shopping_cart.rb:11:in add
app/controllers/shopping_carts_controller.rb:38:in add_to_cart
Any suggestions on this, will be appreciated. Thanks in advance
this one is still not yet supported for Rails 5 https://github.com/crowdint/acts_as_shopping_cart, you could try this one https://github.com/dabit/acts_as_shopping_cart
Late reply, but I was banging my head on this one for too long so I thought this may help other people.
You're getting the MissingAttributeError because your shopping_carts table doesn't have a price_cents field. The previous version of acts_as_shopping_cart (~ 0.2.2) was setup to use a float field called price, and it did not use the money-rails gem. The newer versions (>= 0.4.0) use money-rails and an integer field called price_cents, then money-rails "automagically" creates a attribute called "price" that converts to/from the price_cents field.
You may be able to migrate your price field using one of their helpers:
https://github.com/RubyMoney/money-rails#migration-helpers

Sitecore 7.5 upgrade

I am upgrading Sitecore 7.2 to Sitecore 7.5 .
Everything went good, but when I have to convert data for analytics I see many errors passing. First I did it without WFFM parameters, which worked perfectly.
Then a restored my original database and executed the same command with the WFFM parameters.
Now is see hundreds of erros passing in my conversion tool:
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Sitecore.Forms.ConversionTool
at Sitecore.Forms.ConversionTool.ConversionPipeline.<Process>b__2(VisitsRow v)
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at Sitecore.Forms.ConversionTool.ConversionPipeline.Process(VisitExtensionArgs args)
at ...
Anyone who has an idea what is causing this error?
I had the same error and raised a support issue with Sitecore. Their answer was that the documentation in the xDB Upgrade and Conversion Guide is wrong with regards to the data reader type.
The documentation says:
/wffmreadertype "Sitecore.Forms.ConversionTool.Reader.SqlServerReader, Sitecore.Forms.ConversionTool"
It should be:
/wffmreadertype Sitecore.Forms.ConversionTool.Reader.SqlServerReader

Getting error while reading salesforce custom field type Rich Textarea

I am using salesforce.cfc (downloded from Riaforge) to integrate coldfusion with salesforce.
<cfset latestProductList = salesforce.queryObject("SELECT Id, Name, Description__c, Price__c, ProductImage__c FROM Product__c") />
I have created one custom object named "Product__c". This object have one custom field "ProductImage__c" type "Rich TextArea". When i an trying to get product without this custom field it is run, but when i am trying to get product with this field i am getting below error:
"INVALID_FIELD: Name, Description__c, Price__c, ProductImage__c FROM Product__c ^ ERROR at Row:1:Column:44 No such column 'ProductImage__c' on entity 'Product__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. "
But i have this field. attached screen image of salesforce below.
Thanks,
Arun
A quick look at Salesforce CFC shows that it hasn't been updated in a while. The file SalesForce.cfc is pointing at:
https://www.salesforce.com/services/Soap/u/11.1
That's version 11.1 of the API, which is quite old and is long before rich text fields came into existence.
You might be able to fix this issue by simply updating the reference in SalesForce.cfc to the latest version of the API by changing
https://www.salesforce.com/services/Soap/u/11.1
to
https://www.salesforce.com/services/Soap/u/28.0
in that file, although there's a pretty good likelihood that that will break something else, since version 28.0 will have lots of new stuff that SalesForce.cfc is not coded to handle.
In any case, your problem is in fact the API version that you're using. In cases like this, when a field type did not exist as of a certain API version, then that field is invisible for that version. In your case, your rich text field is invisible for your API version, 11.1.

Sitecore: Seemingly Random errors appear

we are experiencing some very odd errors in our installation.
Some times out of nowhere Sitecore throws an error:
Assert: Value Cannot be null. Parameter: Item.
The closest i have come to identifying the problem is narrowing it down to either an index or the web database.
Anyway, if I log into sitecore the Item is just missing, i can fix it in 3 ways:
Rebuild the index.
Recycle app pool
iisreset
Does any of you have an idea why this might be happening? We are running Sitecore.NET 6.5.0 (rev. 120706). Any help will be deeply appreciated.
You are describing a system stability issue, so I recommend opening a ticket with Sitecore support (http://support.sitecore.net). This sort of issue is difficult to troubleshoot over Stack Overflow, since we do not have access to your logs and configuration.
When opening the ticket, I recommend using the Support Package Generator which bundles up all the information (Web.config, App_Config files, IIS settings, Sitecore log files) that Sitecore Support needs to troubleshoot the issue. It's a pretty nifty tool.
That said, from what you describe, it sounds like the issue is related to caching. The fact that restarting IIS resolves the issue indicates that the item is in the Web database, but the runtime doesn't see it. You can prove out whether this is the issue by clearing cache using the /sitecore/admin/cache.aspx screen. If your cache is not getting updated properly, you should review your configuration against the guidelines in the SDN Scaling Guide.
Based on knowing you're using the Advanced Database Crawler, your issue may be how you're converting a SkinnyItem to an Item. I've had this issue before. If you look at the SkinnyItem.cs class, there's a GetItem() method to convert it into an Item. You can see it uses the database to get the item by its ID, language, and version number. Its possible that when you publish from master to web, you are publishing a new version # of an existing item and thus the new version exists in the web DB, but the index is not updated and references the old version. So, this GetItem() call would use the previous version # and the item would be null. One way to fix this is instead of calling that GetItem() method, just use your own code to get the latest version of that item from Sitecore, e.g.
Item item = Sitecore.Context.Database.GetItem(someSkinnyItem.ItemID);
Instead of
Item item = someSkinnyItem.GetItem();
Here's an example flow:
Foo item created in master DB as version 1.
Publish Foo to web
Index will pick up version 1 in web DB and put in index.
Any querying code against index will convert the SkinnyItem to an Item via that GetItem() method and will pass 1 as the version #.
Page will load, no error in log
Back in master, create version 2 of Foo and publish.
Index may not get updated right away or even if configured wrong.
Code that looks against index will call GetItem() and still call with version 1 since that's in the index
But when you published, web no longer has version 1, it now has version 2, and thus that specific version of that item Foo is null
Error shows in log
On a similar note, here's a blog post by Alex Shyba (creator of the ADC) on how to sync HTML cache clearing with the index updates. That may help.