Deleting unused CSS from master page in Sharepoint - sharepoint

I've a couple of css file that were used in previous versions of the master page but now they are not referenced in the page. However, while i try to delete them, the following error message prompts:
Server error: This item cannot be deleted because it is still referenced by other pages.
I've gone through some older forum suggestions and there seems to be a hack by creating a temp folder, moving those css files into the temp folder and deleting the folder itself after turning off all the versioning thing. But, the domain that has the method written clearly has expired and I don't seem to have a specific solution to this thing as of now.
I'd be grateful to have a little help with this.

Try to deactivated publishing feature and then delete the files.
Or create a new master page and apply the master page to default, then delete the master page.
And try to delete master page using PowerShell.
$spWeb = Get-SPWeb "http://sharepoint.site.com/"
$masterpageGallery = $spWeb.GetFolder("_catalogs/masterpage")
$masterpage = $masterpageGallery.Files["MyMasterPage.master"]
$masterpage.Delete();
$spWeb.Dispose();

Related

Error after moving pimcore to remote server

I have moved a pimcore 1.4 site to a new server, all files and database and although the admin works fine, the following error is thrown trying to access any public facing pages.
Argument 1 passed to Pimcore\Model\Object\Localizedfield::setClass()
must be an instance of Pimcore\Model\Object\ClassDefinition,
null given, called in
/xxxxxx/models/Object/Listing/Concrete/Dao.php on line 122
Are you sure that all files were moved correctly to new server? Especially check website/var/classes directory and content of the website/var/config/system.xml file.
After some investigation, I discovered that not all of the database tables had imported.
I also found other users deep in the pimcore forums with the same issue, so this is the first place to check.

Script file file not being loaded through ScriptLink custom action

I am having trouble with script link custom actions. I am building a SharePoint app, and I successfully added a site-scope custom action pointing to a script file in the Style Library, as I want this particular script to be injected to all the pages of my SharePoint site.
While it works in certain situations, the script link injection breaks without apparent reason under certain conditions. For example, when I arrive on my root web, the script will be injected. But, if I go to a certain link within this web (for example Home or Site Contents), the file that is supposed to be injected will simply not be fetched from the Style Library and therefore never be injected, resulting in an uncaught ReferenceError when I try to call one of the script's function. The weirdest part is that a page refresh through Ctrl+F5 will fetch the script file without any problem, regardless of the page's ability to originally fetch the script file when first accessed. It will keep the script until it is accessed through a link again.
I've read up on Sharepoint caching, thinking it may be the cause of my problem, but the trouble is that these articles mostly talk about cache-induced errors when updating a file, while I am only trying to access it.
One thing to note is that, due to limitations, I am adding the script link custom action through code. Here's an example of what this kind of call currently looks like in my app:
context.Load(context.Site.UserCustomActions);
context.ExecuteQuery();
customAction.Name = "MyScriptLink";
customAction.Location = "ScriptLink";
customAction.Sequence = 100;
customAction.ScriptSrc = "~SiteCollection/Style Library/MySite/MyScript.js";
customAction.Update();
context.ExecuteQuery();
So, what's going on here ? Why is my script no injected on certain pages ? Why does a refresh on these exact same pages manage to fetch the file without any problem ?
Found it ! Three words: Minimum Download Strategy. Disable it, it messes with you page redirect behavior within a SharePoint site (either through code or through site settings)
Edit: If you still want MDS enabled on your site, there is a solution

CF and PDF in secure environment

I'm using CF9. My problem pertains to an admin application that sets session variables at login to identify the user and user permissions. Depending on the user level, certain pages are allowed for viewing and other pages are not allowed. (I'll refer to this as my 'security framework'. This is wrapped around everything in the root.)
This security framework consists of a cfif statement at the top of the CFM page and a closing cfelse and (</)cfif at the bottom of the page. Everything between this opening cfif and closing cfif displays if the user has that level permission - standard stuff.
Certain users can upload PDF files, no problem here. PDF files are uploaded to a folder outside of the root and then moved and renamed to folders inside the root.
When uploading, the user chooses categories and subcategories etc. and these variables are inserted in a SQL database during the upload process. Therefore, I have filePaths and fileNames, etc. to set up dynamic links on a page for a user to click and load the PDF (password protected) in the browser.
I have the dynamic link pointing to a ShowThisPDF.cfm? with URL variables filePath= #filePath# & fileName = #fileName#. I've set up the ShowThisPDF.cfm with the security framework at the top and bottom of the page and am trying to copy the uploaded PDF into this page so that the PDF will display in the browser.
I've tried many ways to do this with cfdocument and cfpdf and cfcontent, etc. When I read the error that this is throwing, it does look like it is reaching the uploaded file but I get an "access denied" every time, due to the security framework I suppose.
On a side note, elsewhere in this application I can create a PDF from my cf pages with cfdocument with the security framework wrapped around the page and this works perfectly - displaying the PDF in the browser. My problem is in loading an existing PDF into a CFM page that has the security framework - which should allow the PDF to load.
Anyone have an idea as to how I can accomplish the above? I hate to try and bypass my security and it seems logical to "copy" the uploaded PDF into a CFM page that wraps the PDF in the security framework and then display the PDF in the browser.
Agree with Dan - I had similar issue. So I ended up doing https: with a windows login and also a ColdFusion Login to Web Application. At end of day - they need 2 logins to get into the system - then they can see the pdf files etc or what they need.

Spotify: Where excactly to put the app?

I have a Spotify developer account, this also shows in Spotify Client.
However, I'm having problems with my test app. I just copied the tutorial app from the Spotify deveopment pages.
In Program files\Spotify i put the folder tutorial with the app files.
I also made this directory: Libraries\My Dokuments\Spotify\tutorial\
This did not work. When searching for spotify:app:tutorial I got metadata error and "could not find this app". When changing the "t" to "T" (Tutorial with upper case T), I did not get "could not find"-message, but nothing happened. Also I got the message "metadatastarted" while "loading for ever".
I tried this path: Users\P45\AppData\Local\Spotify\tutorial
This did not help.
These are the directories I made:
Libraries\My Dokuments\Spotify\tutorial\
Program files\Spotify\tutorial\
Users\P45\AppData\Local\Spotify\tutorial\
Any suggestions?
(Also, more info I should provide? Other changes?)
Create "My Documents\Spotify" in your %USERPROFILE% folder (you should already have 'My Documents' there, assuming it is english windows, so just create "Spotify" under that), and then create your app folder, "tutorial" there. That is where your files should reside in.
Note that %USERPROFILE% probably does not point to 'Libraries' folder.
Metadata error however suggest you might have also an error with your application and not only with your folder path... if possible, post your manifest.json and index.html files, too, to fix that.
This is a simple app I made earlier on, you can check from there the bare minimum metadata stuff as well as the instructions. For completeness, this is the link to official instructions provided by Spotify.

Possible for Word to edit documents directly off an web server without Sharepoint?

I have a use case that seems pretty simple, but after Googling around I can't find a solution. I have some Word documents on an FTP server and I'd like to be able to create a link that would download them into Word and then allow the saved changes to be sent back to the FTP server.
The problem is that I can only get Word to either open the file from the FTP server as read-only and I can't save the changes back to the server automatically, or the file downloads to a temporary location which isn't automatically saved back to the server. I'm creating my link like this:
Test
Frustratingly, if I go into Word File|Open and paste the link "ftp://ftp.example.com/www/uploads/Image/test.doc" I can save back to the server. What gives? Is there a solution? From Googling around it seems that Sharepoint offers this ability, but that's not practical for us. We're using IE7 and Office 2003.
I believe Microsoft Word can read / write WebDAV - see this question:
Editable Word Document from JSP
Can you set up some kind of proxy that can connect via FTP?
Read this link http://www.webdavsystem.com/server/documentation/ms_office_read_only (is actually about webdav, but I'd guess this is the same issue for FTP), there is a section on on opening weblinked documents in non-readonly mode. Which needs some changes on the client side...
HTH
Tim
Solution for IE:
Put a file on ajaxbrowser.com (this is WebDAV Server for testing) and replace file's full path in the next code:
var openDocumentsObject = new ActiveXObject("SharePoint.OpenDocuments");
openDocumentsObject.EditDocument('http://ajaxbrowser.com/mydoc.docx');
Another example:
<a href='http://ajaxbrowser.com/mydoc.docx' id='urltarget' target='_blank'>Edit through URI</a>

Resources