NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription ignored - swift3

Xcode 8.2 beta 8C30a, Swift 3, iPhone 5s.
I'm writing a weather app that wants to use the iPhone's location. To get authorisation I have set (all of) the following my Info.plist:
<key>NSLocationAlwaysUsageDescription</key>
<string>Your current location is used to provide you with a local weather forecast.</string>
<key>NSLocationUsageDescription</key>
<string>Your current location is used to provide you with a local weather forecast.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your current location is used to provide you with a local weather forecast.</string>
Nevertheless, when I call LocationManager.requestWhenInUseAuthorization() then I get the following error:
This app has attempted to access privacy-sensitive data without a usage description.
The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key
with a string value explaining to the user how the app uses this data
The key is there but not being seen. There is no entry for the app in the phone's settings menu (nor under privacy). Doubtless, I'm missing something simple. Any ideas?

I just encountered the same problem with one particular App, and I have several Apps with the same structure which are working just fine when I request authorization for Location Services.
In all cases, I have localized the Application, so I have several Info.plist files in my XCode project (e.g. one for the Base language which is English, another for French, etc).
I always manually edit my Info.plist files (viewing them "as Source Code") and add the NSLocationWhenInUseUsageDescription fields).
But in this specific App's case, I noticed that XCode was NOT showing the NSLocationWhenInUsageDescription field when I selected the App Target in the Project's list of Targets and then clicked on the "Info" tab. This is odd, because when I check the "Info" tab in my other XCode projects, edits made to the Info.plist file for the Base language appear here. So I manually added a NSLocationWhenInUseUsageDescription field to this "Info" UI and suddenly my new App was working correctly, requesting the user's permission to access Location Services when in use.
I'd recommend checking that all the fields you have added to your Info.plist file are reflected in the Target/Info screen. If they are not, you may have a similar problem, in which case the same fix may work for you.
I am guessing the root cause of the problem is a bug in the localization process. I recall that after selecting the Info.plist file as one of my localized files, I got an error from XCode at build time, complaining that it was missing an Info.plist file (it had moved Info.plist from the base.lproj folder to en.lproj when it "localized" the file). I reinstated the file that XCode had moved from the base.lproj folder to the en.lproj folder, and that seemed to make XCode happy again. But I think somehow it lost the ability to refresh itself, so subsequent additions to the Info.plist file(s) aren't being applied everywhere they need to be).

Related

Set screenshot path from default project location to different folder location

I have a suite which has 50 test cases. When I execute my suite, I get all the failed screenshots listed in the project's folder. I want to point and store those screenshots to a different directory with the name of the test case. I wanted it to be a one time setup than doing it explicitly for every test cases.
There's quite a few ways to change the screenshots default directory.
One way is to set the screenshot_root_directory argument when importing Selenium2Library. See the importing section of Selenium2Library's documentation, and importing libraries in the user guide.
Another way is to use the Set Screenshot Directory keyword, which will do pretty much the same thing as specifying a path when importing the library. Though, using this keyword you can set the path to a new one whenever you like. For example, you could make it so that each test case could have it's own screenshot directory using this keyword. According to your question, this may be the best solution.
And finally, you may also post-process screenshots using an external tool, or even a listener, that would move all screenshots to another directory. Previously mentioned solutions are in most cases much better, but you still may want to do this in some cases, where say, the directory where you want screenshots to be saved would be created only after the tests have finished executing.
I suggest you to do the follow:
For new directory, you should put the following immediately after where you open a browser such:
Open Browser ${URL} chrome
Set screenshot directory ${OUTPUT FILE}${/}..${/}${TEST_NAME}${/}
For replace the screenshot name from the default to your own name, create the following keyword:
sc
Capture page screenshot filename=${SUITE_NAME}-{index}.png
Then, create another keyword and run it on Setup's test case:
Register Keyword To Run On Failure sc
In the above example, I created a new folder with the test case name, which create a screenshot (in case of failure) with the name of suite project name (instead of 'selenium-screenshot-1.png').

How do I track down specifics for an opencart module that is rendering on my site but missing everything except the catalog template file?

I've inherited an opencart 1.5.5.1 site and am completely new to the cms. From what I've been able to gather, it was built by a competent developer but then went through a hack-it-up development team, and then on to me. So, I really don't know what all to expect from it.
I currently have a module that is rendering in the left sidebar and I don't know why it's rendering there. The only file I can find in the file stack related at all to this "module" is a single template file within the catalog directory structure called:
/catalog/view/theme/mytheme/template/module/affiliate_profile_select.tpl
All of the other installed modules on the site seem to have lots of other files associated with them, whose locations are verified by the research I've done on creating opencart modules: ie, module files in the following directories:
/catalog/controller/module/
/catalog/language/english/module/
/catalog/model/module/
/catalog/view/theme/mytheme/template/module/
/admin/controller/module/
/admin/language/english/module/
/admin/model/module/
/admin/view/template/module/
From what I've been able to find though, this single file (affiliate_profile_select.tpl) is the only file in the file stack that is associated with this module.
I can't find anything related to this module, and/or file, inside any of the vqmod php or xml files.
I can't find anything related to this module in the admin area. I've tried searching through all of the installed modules for other generic identifiers (the section view is rendering at the very top of the left-sidebar on most non-logged-in pages, so I'm looking for layout locations of "Left Sidebar" and positions less than 2), but haven't found anything.
And yet, the section is obviously rendering on the site, so it has to be there somewhere. In fact, it's rendering in two places. It's also in the top-content section of the mobile view of the home page.
Right now it's almost feeling like it was a module that had been written, installed, and configured, and then someone deleted all but one of the files associated with the module. Could a situation like that happen?
Is there any way to track this issue down by querying the database? Or would the template inclusion obviously be inside a file somewhere and I just need to find it? To complicate matters, the hosting company doesn't allow remote login with a console (from what I can tell). Otherwise I'd just have run a grep for the filename in case someone had just thrown an "include()" statement in somewhere. The only place I've checked for something like that so far was in the left-sidebar template file:
/catalog/view/theme/default/template/common/column_left.tpl
but it's just a simple for-loop that echoes out the module views.
Any help or direction on how I might be able to track this problem down would be of significant help.
In Opencart, .tpl (template) files are always called by controllers which as you probably guessed are in catalog/controller/. An if it's a module (showing in left sidebar position, it's probably going to be in catalog/controller/module/. First order of business would be to find the controller that's calling the template you referred to. I'd probably start by getting into a shell and doing something like this from the site's docroot:
grep -r affiliate_profile_select .
From there you should be able to find the associated module controller and any other logic involved. Sometimes people use vQmod to add something on to a pre-existing module so that can possibly explain the lack of other similarly named files.

linking to cfml code ala jsfiddle

ok so i'm working on a new version of cflive.net and one of the features is to link to code.
I am using jsfiddle.net as my inspiration for the new site.
Now with jsfiddle all the code runs in the client, so it is not a problem for other people to edit it.
But with CFML obviously the files need to be saved on the server first, which means the original file would get overwritten if anyone makes any changes, which is obviously going to be problematic as the original author may not want his files to get edited, so I am looking for some feedback/suggestions on what would be the best way to handle this.
My best idea so far is.
All files are stored in a unique folder using a JsessionID
e.g. anonymous files
/jsessionid/filename.cfm
or user files
/user/jsessionid/filename.cfm
the original author marks the files as editable or not. You must register and be logged in to have this control.
Files created anonymously (not logged in) can be edited as default.
If the file is editable then it can be edited, otherwise it gets duplicated for each new session.
Anonymous sessions get deleted if they have not been access for 90 days.
thoughts?

Browse media library not opening

We are using Sitecore 6.5 and the Browse link on images within the CMS backend is not opening up the window to select an image. A blank window just appears.
There is nothing in the Sitecore logs or window event logs. This used to work - when I compare the bin folders with the previous version, I only see a difference in the version of mscorlib.dll
I don't know if this is related, but when uploading a package we get the error
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
System.Reflection.RuntimeModule.GetTypes() +9
System.Reflection.Assembly.GetTypes() +143
I've seen something similar to this when the source path specified on the field was set to an invalid folder. If you take a look at the field definitions on the template, do they have a folder specified for the image location? Is that folder still valid?
The problem was the \sitecore\shell\applications\Media\MediaBrowser\MediaBrowser.xml file was complete empty.
We have no idea how this happened. Restoring the xml fixed this issue.

Umbraco error in Document Types

A long time ago I first setup a website in Umbraco. This seemed to be working fine.
I have now come back to it about a year later, and was initially getting the following error when selecting a Document Type (any document type in the Settings tab):
A bit weird, because earlier I didn't have this issue, but fine. I do what it says, and add <identity impersonate="true"/> to the <system.web> node in web.config.
While it does fix the initial issue, I now have the following on all document types:
When trying to create a new Document Type, I get the same kind of error, but then the ReturnUrl part is ReturnUrl=/umbraco/create.aspx?nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2&nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2' - but only if I tick the box 'Create template for this item'. The same happens when I try and create a Template.
After Googleing I came up with this: our.umbraco post with similar issue. One (unconfirmed) solution is that there's an illegal name in a document type/ template - but I haven't changed anything, and might be fixed by going into the database.
I did check the /masterpages folder, the only 'strange' characters in there are - and _.
In my Document Types I have on named 'Textpage (Two col)' and another named 'News & Events list'. I'm a bit hesitant to just delete them, since I don't have enough Umbraco knoledge to be sure this will fix my issue...
Is there any known solution for this, or will I also have to go into the database (and if so, whereabouts?)
I'm running Umbraco 4.7.2, assembly version 1.0.4500.21031.
I've hosted this site with GoDaddy.com - I don't know if that would be relevant.
[Update 1]
As per Tom Maton's comment:
The requirepermissions should be set to false, and have been.
in Appsettings I've set this:
<add key="umbracoUseMediumTrust" value="true" />
And I've added Trusted_Connection=yes to the connectionstring.
the problem remains.
[Update 2]
Tried the solution amelvin provided, but no dice. Doctypes and templates still give the error. I'm getting more certain it's some security issues. Which folder would correspond to the Templates? Would that be the masterpages folder? If so, what kind of permissions does that one need?
It could be that you don't have full trust on your Go Daddy environment?
Check this post out http://our.umbraco.org/forum/getting-started/installing-umbraco/17856-Umbraco-on-GoDaddy-Shared-Hosting
Could help resolve your issue.
The error could be a knock on from permissions errors as yet unsolved.
But the error is thrown if the content page does not have a template assigned or if Umbraco thinks it doesn't have a template. If absolutely nothing has changed to the site then it could be that the umbraco.config file has somehow got corrupted (it will contain all the doctype/template cross reference info). This can be fixed by right clicking on the top 'content' node and choose 'republish entire website'.
Secondly navigate to the settings | document types (if you can now) and check the templates dropdown on the first tab of the appropriate document type. If its set to 'please select' then this error will get thrown when any page tries to render without a valid template assigned. If a default template is assigned - then go to that template and re-publish it - Umbraco may have lost it.
If this does not work then check if the template is assigned properly. Go to the same place in the content tree as the problem page and try to add a node with the desired doctype. If no choices are offered then it could be that the parent tab no longer allows the correct doctypes as children nodes, so go back to the doctypes and check the allowed children (second tab) of the parent node.
If none of this works without odd errors being thrown then its a mystery!
Here are a list of Permissions required for Umbraco http://our.umbraco.org/wiki/reference/files-and-folders/permissions
Or you could use one of the steps below to check all the folder permissions.
http://our.umbraco.org/wiki/reference/files-and-folders/permissions/perform-permissions-check
Or install this package. http://our.umbraco.org/projects/backoffice-extensions/ugolive this will allow you to check the permissions are correctly setup.