Error when trying to swap content in 2sxc module - dotnetnuke

I am working on two sites that have identical bases for all of my 2sxc data/views. I built the first site with no issues, added all my data and was able to add a demo item and then change it to be a data item that already existed in the system.
When I started on my 2nd site, I recreated all the data types and views and started adding content. Adding, deleting and rearranging seems to work fine. But when I try to add a demo item to change it to an existing item, it won't let me change it. I get this error in a popup.
"Had an error talking to the server (status 400)."
So I went back to my first site and now it's doing the same thing. I can't think of anything that would have changed on the first site as far as setup goes. I'm sure I've added more data items since then but I haven't done anything with the data types or view settings.
In each individual module that I've tested, I can still add, delete and move items fine. Just can't swap it for an existing item. Any ideas? I've tried clearing the site cache, restarting the site and reapplying permissions on the entire site as well.
I am running DNN 8.0.4 and 2sxc 9.14.0.
I've enabled the extensive logging and this is what I get...
1) When I click on the Replace button:
2sxc-Api:/desktopmodules/2sxc/api/app-sys/contentgroup/replace?appId=2&guid=9b9f6f01-063a-481d-a3c7-f2c5923a1fc8&index=1&part=content
ModuleId:2766
2sCoGr(65)CB.Mod(37):parent#2766, content-block#2766, z#2, a#2
2sCoGr(65)CB.Mod(37):real app, will load data
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab):prep App z#2, a#2, allowSE:True, P:0
2sCoGr(65)CB.Mod(37)Sxc.Instnc(ef):get SxcInstance for a:2 cb:2766
2sCoGr(65)CB.Mod(37)Sxc.Instnc(ef)DNN.Enviro(ef)DN:checking requirements first time for mod:2766
2sCoGr(65)CB.Mod(37)Sxc.Instnc(ef)DNN.Enviro(ef)DN:decision: DraftOptional
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab):init data drafts:True, vers:False, hasConf:True
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab)CG.Manage(04):find content-group for mid#2766 and tab#123
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab)CG.Manage(04):get CG or gen preview for grp#9b9f6f01-063a-481d-a3c7-f2c5923a1fc8, preview#00000000-0000-0000-0000-000000000000
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab)CG.Manage(04):get CG#9b9f6f01-063a-481d-a3c7-f2c5923a1fc8
2sCoGr(65)CB.Mod(37)DS.Create(cb):will create view data source
2sCoGr(65)CB.Mod(37)DS.Create(cb):mid#2766, draft:True, template:Staff-Specialty
2sCoGr(65)CB.Mod(37)DS.Factry(37):get init #2/2, draft:True, config:True
2sCoGr(65)CB.Mod(37)DS.Create(cb):use pipeline upstream:True
2sCoGr(65)CB.Mod(37)DS.Create(cb):override template, & pipe#
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab):init data drafts:True, vers:False, hasConf:True
2sCoGr(65):replace target:9b9f6f01-063a-481d-a3c7-f2c5923a1fc8, part:content, index:1
2sCoGr(65):get group:9b9f6f01-063a-481d-a3c7-f2c5923a1fc8
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab)CG.Manage(04):get CG#9b9f6f01-063a-481d-a3c7-f2c5923a1fc8
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab):configure on demand start
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab)DS.Factry(a8):get init #2/2, draft:True, config:True
2sCoGr(65)CB.Mod(37)App.2sxcAp(ab):configure on demand completed
Server Name: Cloud23294
2) When I select an item to replace and click the checkbox button, nothing shows up in the logs - just this popup:
Had an error talking to the server (status 400).
If you are an advanced user...
3) When I close out of the Replace Content popup:
2sxc-Api:/DesktopModules/2sxc/API/view/module/rendertemplate?templateId=-1&lang=en-us&cbisentity=false&cbid=2766&originalparameters=%5B%7B%22Key%22%3A%22TabId%22%2C%22Value%22%3A%22123%22%7D%2C%7B%22Key%22%3A%22language%22%2C%22Value%22%3A%22en-US%22%7D%5D
ModuleId:2766
2sModC(f9)CB.Mod(2a):parent#2766, content-block#2766, z#2, a#2
2sModC(f9)CB.Mod(2a):real app, will load data
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc):prep App z#2, a#2, allowSE:True, P:0
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7):get SxcInstance for a:2 cb:2766
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)DNN.Enviro(da)DN:checking requirements first time for mod:2766
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)DNN.Enviro(da)DN:decision: DraftOptional
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc):init data drafts:True, vers:False, hasConf:True
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc)CG.Manage(32):find content-group for mid#2766 and tab#123
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc)CG.Manage(32):get CG or gen preview for grp#9b9f6f01-063a-481d-a3c7-f2c5923a1fc8, preview#00000000-0000-0000-0000-000000000000
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc)CG.Manage(32):get CG#9b9f6f01-063a-481d-a3c7-f2c5923a1fc8
2sModC(f9)CB.Mod(2a)DS.Create(47):will create view data source
2sModC(f9)CB.Mod(2a)DS.Create(47):mid#2766, draft:True, template:Staff-Specialty
2sModC(f9)CB.Mod(2a)DS.Factry(a0):get init #2/2, draft:True, config:True
2sModC(f9)CB.Mod(2a)DS.Create(47):use pipeline upstream:True
2sModC(f9)CB.Mod(2a)DS.Create(47):override template, & pipe#
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc):init data drafts:True, vers:False, hasConf:True
2sModC(f9):render template:-1, lang:en-us, isEnt:False
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7):render
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7):system is ready, no upgrade-message to show
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7):pre-init innerContent content is empty so no errors, will build
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7):standard case, found template, will render
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)Htm.RendEn(c7)Ap:init for itm:5885c784-77b3-4c0d-a774-7601101b690b (947)
2sModC(f9)CB.Mod(2a)App.2sxcAp(dc):init data drafts:True, vers:False, hasConf:True
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)Htm.RendEn(c7):will render razor template
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)Htm.RendEn(c7):will render into textwriter
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)Sxc.AppHlp(e4):try to build List and Content objects
2sModC(f9)CB.Mod(2a)DS.Module(19):need content-group, will use from sxc-context
2sModC(f9)CB.Mod(2a)DS.Module(19):get stream content⋮2, demo#894, present⋮2, presDemo#, header:False
2sModC(f9)CB.Mod(2a)DS.Publsh(45):get incl. draft:True
2sModC(f9)CB.Mod(2a)DS.Module(19):stream:content - items⋮2
2sModC(f9)CB.Mod(2a)Sxc.Instnc(d7)DN.Render(3e)Sxc:building entire client-context
Server Name: Cloud23294

Test it with the new version 2sxc 9.13. The error from 9.12 is fixed.

After a deeper analysis, it seems that a client security software called WebRoot was interfering. So problem solved :).

Related

How to make Selenium-Wire perform an indirect GraphQL AJAX request I expect and need?

Background story: I need to obtain the handles of the tagged Twitter users from an attached Twitter media. There's no current API method to do that unfortunately (see https://twittercommunity.com/t/how-to-get-tags-of-a-media-in-a-tweet/185614 and https://github.com/twitterdev/open-evolution/issues/34).
I have no other choice but to scrape, this is an example URL: https://twitter.com/justinwood_/status/1626275168157851650/media_tags. This is the page which pops up when you click on the tags link under the media of the parent Tweet: https://twitter.com/justinwood_/status/1626275168157851650/
The React generated DOM is deep and ugly, but would be scrapeable, however I do not want to log in with any account to get banned. Unfortunately when you visit https://twitter.com/justinwood_/status/1626275168157851650/media_tags in an Incognito window the popup shows up dead empty. However when I dig into the network requests the /TweetDetail GraphQL endpoint is full of messages about the anonymous page visit, fortunately it still contains the list of handles I need despite of all of this.
So what I need to have is a scraper which is able to process JavaScript, and capture the response for that specific GraphQL call. Selenium uses a headless Chrome under the hood, so it is able to process JavaScript, and Selenium-Wire offers the ability to capture the response.
Unfortunately my crafted Selenium-Wire script only has the TweetResultByRestId and UsersByRestId GraphQL requests but is missing the TweetDetail. I don't know what to tweak to make all the requests to happen. I iterated over a ton of Chrome options. Here is a variation of my script:
from seleniumwire import webdriver
from selenium.webdriver.chrome.service import Service
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless") # for Jenkins
chrome_options.add_argument("--disable-dev-shm-usage") # Jenkins
chrome_options.add_argument('--start-maximized')
chrome_options.add_argument('--window-size=1900,1080')
chrome_options.add_argument('--ignore-certificate-errors-spki-list')
chrome_options.add_argument('--ignore-ssl-errors')
selenium_options = {
'request_storage_base_dir': '/tmp', # Use /tmp to store captured data
'exclude_hosts': ''
}
ser = Service('/usr/bin/chromedriver')
ser.service_args=["--verbose", "--log-path=test.log"]
driver = webdriver.Chrome(service=ser, options=chrome_options, seleniumwire_options=selenium_options)
tweet_id = "1626275168157851650"
twitter_media_url = f"https://twitter.com/justinwood_/status/{tweet_id}/media_tags"
driver.get(twitter_media_url)
driver.wait_for_request("/TweetDetail", timeout=10)
Any ideas?
Apparently it looks like I'd rather need to scrape the parent Tweet URL https://twitter.com/justinwood_/status/1626275168157851650/ and right now it seems my craved GraphQL call happens. Probably I got confused while trying 100 combinations.

Offline HLS Fairplay playback error when the app is closed, code 16227

I'm implementing Offline Playback with HLS Fairplay following the demo in the FairPlay Streaming Server SDK v4.0.1 that uses AVContentSessionKey.
I download three contents, each content is downloaded and persisted correctly, both the .movpkg and its content key on the documents directory, when I turn off the WIFI these three contents downloaded plays correctly without any problems, before playing Im using this code:
let urlAsset = element.urlAsset!
ContentKeyManager.shared.contentKeySession.addContentKeyRecipient(urlAsset)
if !urlAsset.resourceLoader.preloadsEligibleContentKeys {
urlAsset.resourceLoader.preloadsEligibleContentKeys = true
}
self.present(playerViewController, animated: true, completion: {
AssetPlaybackManager.sharedManager.setAssetForPlayback(urlAsset)
})
So far so good. But the problem is when I close the application (Home button to close applications) and then play the downloaded contents, only the last content downloaded plays correctly, the other ones (first and second) send these error on the console.
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"
UserInfo={NSUnderlyingError=0x1c065d760 {Error Domain=NSOSStatusErrorDomain Code=-16227 "(null)"},
NSLocalizedFailureReason=An unknown error occurred (-16227),
NSURL=file:///private/var/mobile/Containers/Data/Application/A950D8DB-B711-47E3-AAF5-C95CC9682430/Library/com.apple.UserManagedAssets.kkG8Ih/644986_7798B8476A473F68.movpkg/, NSLocalizedDescription=The operation could not be completed}
I double check the .movpkg with the keys in the documents directory and appears correctly
/Documents/.keys/one-key
/Documents/.keys/two-key
/Documents/.keys/three-key
Before the error occurs the ContentKeyDelegate is called and the key is loaded and passed to the request correctly.
if persistableContentKeyExistsOnDisk(withContentKeyIdentifier: assetIDString) {
let urlToPersistableKey = urlForPersistableContentKey(withContentKeyIdentifier: assetIDString)
guard let contentKey = FileManager.default.contents(atPath: urlToPersistableKey.path) else {
/
pendingPersistableContentKeyIdentifiers.remove(assetIDString)
return
}
/
Create an AVContentKeyResponse from the persistent key data to use for requesting a key for
decrypting content.
*/
let keyResponse = AVContentKeyResponse(fairPlayStreamingKeyResponseData: contentKey)
/
keyRequest.processContentKeyResponse(keyResponse)
return
}
If I print the contentKeyRecipients the three contents appears correctly
- (lldb) po
ContentKeyManager.shared.contentKeySession.contentKeyRecipients ▿ 3
elements
- 0 : AVURLAsset: 0x1c0234d40, URL = file:///private/var/mobile/Containers/Data/Application/E791A4DE-4261-46B7-A84D-D10B27035FAE/Library/com.apple.UserManagedAssets.kkG8Ih/539628_20469336224AA388.movpkg
- 1 : AVURLAsset: 0x1c0234fa0, URL = file:///private/var/mobile/Containers/Data/Application/E791A4DE-4261-46B7-A84D-D10B27035FAE/Library/com.apple.UserManagedAssets.kkG8Ih/644986_7798B8476A473F68.movpkg
- 2 : AVURLAsset: 0x1c42391c0, URL = file:///private/var/mobile/Containers/Data/Application/E791A4DE-4261-46B7-A84D-D10B27035FAE/Library/com.apple.UserManagedAssets.kkG8Ih/573744_62377F9549C45B93.movpkg
My tests are in iOS 11.1.2 and iOS 11.2 beta 2
I'm not sure what is happening, but seems to be a problem with the persisted key, I don't how if each content needs to be associated with one AVContentKeySession at time.
If someone faced a similar problem, any help would be appreciated.
Thanks in advance
I'm having similar issue.
however, since I need to support iOS 10, I'm not using the new AVContentKeyResponse class. Instead, I'm loading the persistent content key myself, and pass it to the loading request.
Anyway, I'm getting exact the same error as you and same behavior. One thing to note is that if I remove the code that loads persistent content key from disk, and always fetch the key from server, then everything works. But this defeats the purpose of "offline" playback...
So it seems like the system thinks the persistent content key is invalid...
Which TLLV you used on the server side to specify Rental Duration of the downloaded content? Did you use Content key duration TLLV or Offline Key TLLV? If you used Offline Key TLLV you need to double check that "Content ID" field is different for every downloaded movie.
We had encounter this error message, too.
It will happen when content exceed over expiration date which set in server side.
For example :
We give 10 minutes of expiration date for Video A
Download this Video A, and verify CKC delivery correctly (print log)
Play Video A without connection
Take a break (after 11 minutes), close App, and launch App again, select Video A to Play
Show below error message from AVPlayerItem.error.description:
Error Domain=AVFoundationErrorDomain Code=-11800
"The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16227),
NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1d4257310
{Error Domain=NSOSStatusErrorDomain Code=-16227 "(null)"}}
You can refresh encrypted data again by
AVAssetResourceLoaderDelegate
or use AVContentSessionKey
Reference : https://developer.apple.com/videos/play/wwdc2018/507/
Make sure you set correct offline content identifier on a serverside. The identifier you set should be associated with the specific rendition/stream allowed by the license. This helped me.

ReactJS DropDown and PhantonJS Headless not playing nice together

Good day all,
I'm currently trying to run cucumber tests on a reactjs component, dropdown search selection, running in headless mode, using PhantonJS, but it is causing a weird situation that preventing me from completely these tests.
Using the following reactJs dropdown, http://jedwatson.github.io/react-select/, it is the "'Github users (Async with fetch.js)'"
The current issue that is according is when the scenarios gets to it fourth example test it fails but the same code is used to pass the first three tests.
I thought it was the fourth example so I changed it around with other values and it still fails on the fourth step.
This is the code used to enter the value into the drop down search
find(".Select").trigger("click")
fix_overlap = %{ $('.Select-placeholder').css('z-index', -99999) }
page.execute_script(fix_overlap)
find(".Select .Select-input input").native.send_keys(with)
find(".Select-menu-outer", text: with, visible: :all, match: :first).click
The react control is doing async call to search for the input data from an API endpoint.
I able to run the test in a browser with no issues.
The error that is being returned from the test is that I can't found the value in the drop down.
I have added the options to the environment setup when I'm registering poltergeist,
options = {:js_errors => false, phantomjs_options: ['--debug=true'], debug: false }
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, options)
end
to see if there is an internal error that is not shown in the debug console.
I have done a page.save_screenshot to see the state just before the error and the drop down has the correct value.
Questions
Is there any other options that can be added to show more information/errors?
Has anyone experienced this issue before?
I'm open to any suggestions to fix this weird behaviour.
Extra details
gem 'poltergeist','= 1.9.0'
gem 'cucumber', '~> 2.0'
For the "Cities (Large Dataset)" example on the linked page, the following code selects the "New York" entry for me, without resorting to using trigger, execute_script or native
with = "New York"
section = find('.section', text: 'Cities (Large Dataset)')
section.find('.Select').click
section.find('.Select-placeholder').send_keys(with)
section.find('.VirtualizedSelectOption', exact_text: with).click
That is using the latest Poltergeist and Capybara. Without the latest Capybara you'd probably need to pass a regex as a :text option in the last line rather than the :exact_text option (otherwise you will get multiple respones)
For the "Contributors (Async)" example
with = 'Craig Dallimore'
section = sess.find('.section', text: 'Contributors (Async)')
section.find('.Select').click
section.find('.Select-input input').send_keys(with.gsub(' ', '')
section.find('.Select-option', exact_text: with).click
will select someone

Importing the latitude and longitude into a geofield

I am using bizreview as the theme for my Drupal 7 site. I am using the Feeds module to import thousands of records that are in CSV files into the site. I need to use a geofield to store the locations.
For this I created a field 'Coordinates' in my content type, made it a geofield and set the widget type to latitude/longitude. I can add the locations manually and they do show up in the map, but I just can't import the coordinates with Feeds.
This seems to be an ongoing issue with the geofield/feeds interface (see Drupal issue here). I had the same problem but applied the patch in comment #12 from the aforementioned link which worked.
One suggestion: If the current version of geofield is not the same as the one used in the patch, or if you are running WAMP without Cygwin, I would suggest applying the patch manually by following the directions here, making sure to save a safe backup file in the process. If you haven't worked with patches before, basically all that you (or the patch command) will do for this particular case is add the following lines of code after line 143 in the ./sites/all/modules/geofield/geofield.feeds.inc file (I am working with geofield version 7.x-2.3):
foreach ($field[LANGUAGE_NONE] as $delta => $value) {
if (!empty($value['lat']) && !empty($value['lon'])) {
// Build up geom data.
$field[LANGUAGE_NONE][$delta] = geofield_compute_values($value, 'latlon');
}
}

Facebook (web) dialog started immediately dismissing on iOS6/SDK3.1|3.2

I had some code to post to a friend's facebook wall that upon the deprecation of this via Open Graph I changed to use the deprecated headers and Facebook dialog to include the user in the posting. That has been working for weeks, but seems to have stopped working (worked fine Tuesday, failed Wednesday) in production application (i.e. no code change or re-build.)
I've spent hours trying all sort of things (running on main thread, asserting sessions are live, re-writting to SDK 3.2, uninstalling app/re-installing, completely changing the dialog type and post contents) to restore the ability but whatever I do the dialog immediately dismisses. [Note: There are no developer alerts on our app, and I believe that none of the app settings have changed.]
Here is the code. The facebookManager "performConnectedAction" is from the Facebook sample to ensure an active session (and I assert it w/o problem.) :
NSMutableDictionary *wallPost = [NSMutableDictionary dictionary];
// Content populating not show (and I've tried various simplifications)
// Who to...
[wallPost setObject:_selectedUser.id forKey:kFB_FIELD_TO];
[facebookManager performConnectedAction:^{
FBSession *facebookSession = facebookManager.facebookSession;
Assert( facebookSession.isOpen, #"Need an open Facebook session.");
[FBWebDialogs presentFeedDialogModallyWithSession:facebookSession parameters:wallPost handler:^(FBWebDialogResult result, NSURL *resultURL,NSError *error) {
if ( !!error ) {
[self logEventWithFormat:#"Failed to invite on Facebook [%#]", error];
}
}];
}];
Basically ... not only does the dialog flash up/down, but no callback is given (no error or result provided.) All other parts of the Facebook application continue to operate (our graph calls, our Facebook Friends dialog, and so on.)
I'd appreciate any thoughts on ways to investigate this further. I have filed a bug report:
http://developers.facebook.com/bugs/165456656937602?browse=search_5130e2d7663dd6543665811
I had the same issue and fixed it by delaying the method call like this. My method is fbWallPost
[self performSelector:#selector(fbWallPost) withObject:nil afterDelay:0.5];

Resources