In Sitecore 8.1 update 2, how do we add a custom web edit button in experience editor to unlock items locked by other users using non admin authors in sitecore.
Getting below error while executing the command.
ERROR Error processing command url:/-/speak/request/v1/expeditor/ExperienceEditor.CustomUnlockItem error:System.InvalidOperationException: Could not retrieve request class for url:/-/speak/request/v1/expeditor/ExperienceEditor.CustomUnlockItem
at Sitecore.ExperienceEditor.Speak.Server.RequestHandler.Process(HttpContext context)
at Sitecore.ExperienceEditor.Speak.Server.RequestHandler.ProcessRequest(HttpContext context)
After correcting the config it was working fine, below is the correct configuration.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<commands>
<command name="webedit:customlock">
<patch:attribute name="type"><NameSpace>.CustomLock,<Assembly></patch:attribute>
</command>
</commands>
<sitecore.experienceeditor.speak.requests>
<request name="ExperienceEditor.CustomUnlockItem" type="<NameSpace>.CustomUnlockItem, <Assembly>" />
<request name="ExperienceEditor.GenerateFieldEditorUrl" type="<NameSpace>.GenerateFieldEditorUrl, <Assembly>" />
</sitecore.experienceeditor.speak.requests>
</sitecore>
</configuration>
Related
My organization has implemented a web application in Django, and we need to host it on a Windows system. We are using Django 3.2.8 and Python 3.8.8.
The Django project is currently stored here:
C:\inetpub\wwwroot\CED_HRAP
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="Python FastCGI" path="\*" verb="*" modules="FastCGIModule" scriptProcessor="c:\python38\python.exe|c:\python38\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<defaultDocument>
<files>
<clear />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
<add value="base.html" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
<appSettings>
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\CED_HRAP" />
<add key="WSGI_HANDLER" value="CED_HRAP.wsgi.application" />
<add key="DJANGO_SETTINGS_MODULE" value="CED_HRAP.settings" />
</appSettings>
</configuration>
Our settings.py file is located at
C:\inetpub\wwwroot\CED_HRAP\CED_HRAP\settings.py
We are currently seeing this error message:
HTTP Error 403.14 - Forbidden The Web server is configured to not list
the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and
directory browsing is not enabled on the server.
How should we configure the default documents in the web.config file so that it links to Django's internal routing (urls.py)?
We followed the instructions here:
https://github.com/Johnnyboycurtis/webproject
(youtube: https://www.youtube.com/watch?v=APCQ15YqqQ0)
You can see that the web.config file in the above repository does not have any default documents specified. We added them to web.config in an effort to resolve the current error.
Have also looked at several other tutorials and documents on this process, but have not been able to resolve the problem.
Thanks!
This problem occurs because the website doesn't have the Directory Browsing feature enabled. Also, the default document isn't configured. To resolve this problem, use one of the following methods:
Method 1: Enable the Directory Browsing feature in IIS
To resolve this problem, follow these steps:
Start IIS Manager. To do it, select Start, select Run, type inetmgr.exe, and then select OK.
In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change.
In the Features view, double-click Directory Browsing.
In the Actions pane, select Enable.
Method 2: Add a default document
To resolve this problem, follow these steps:
Start IIS Manager. To do it, select Start, select Run, type inetmgr.exe, and then select OK.
In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change.
In the Features view, double-click Default Document.
In the Actions pane, select Enable.
In the File Name box, type the name of the default document, and then select OK.
I have Django app deployed in Azure Web App.The app is working correctly in development using:
manage.py runserver
The problem comes when the app is deployed and I have to confirm my registration from email, the URL is something like that:
http://testApp.azurewebsites.net/activate/InRoY4Jua1BhYnYuYmci:1b4pyC:R2Gak--Jwgl0z5gqb0mF6a9OPfU/
I got this error:
The request could not be understood by the server due to malformed syntax.
So after removing ":" from the URL the request works(it gives error for invalid activation link)
How could I allow my azure app to use ":" in my urls?
Solution thanks to benjguin!
Ended up using:
<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="<,>,*,%,&,\,?" />
<compilation debug="true" targetFramework="4.0" />
</system.web>
This way I only ignore colon(":") from the invalid characters.
WARNING: the default configuration filters potentially dangerous URLs. The following will disable this protection. Do that knowingly.
You could replace this portion of the web.Config
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
by this one
<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" />
<compilation debug="true" targetFramework="4.0" />
</system.web>
Explanations are available here: https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx
You can edit the web.Config file from testApp.scm.azurewebsites.net (same credentials as for portal.azure.com), Debug Console, CMD, then cd site\wwwroot. Scroll down to web.Config, you'll find a logo with a pen on the left that will open a text editor in the browser.
now I'm using Dianoga (https://github.com/kamsar/Dianoga) for image compression.
This tool is for png and jpg/jpeg files and PNG file is working fine. But, if I upload JPG file, the upload tool box is freezing like screenshot.
This is the execution line.
var jpegtran = Process.Start(ToolPath, " -optimize -copy none -progressive -outfile \"{0}\" \"{0}\"".FormatWith(tempFilePath));
If I change the code like,
var jpegtran = Process.Start(ToolPath, " -optimize -copy none -progressive -outfile \"{1}\" \"{0}\"".FormatWith(tempFilePath));
JPG file updated, but no compression process. The log says,
"ERROR Could not run the 'getMediaStream' pipeline for '/sitecore/media library/Images/satellite-westtibet'. Original media data will be used"
This is my web.config file in /App_Config/Include/.
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<processors>
<attachFile argsType="Sitecore.Pipelines.Attach.AttachArgs">
<processor mode="on" type="Validations.Attach.ImageAttachMaxSize, Custom.Validations" patch:before="processor [#type='Sitecore.Pipelines.Attach.CheckSize,Sitecore.Kernel']">
<restrictedExtensions hint="list">
<extension>.jpg</extension>
<extension>.jepg</extension>
<extension>.png</extension>
<extension>.bmp</extension>
</restrictedExtensions>
</processor>
</attachFile>
<uiUpload>
<processor mode="on" type="Validations.Upload.ImageUploadMaxSize, Custom.Validations" patch:before="processor [#type='Sitecore.Pipelines.Upload.CheckSize, Sitecore.Kernel']">
<restrictedExtensions hint="list">
<extension>.jpg</extension>
<extension>.jepg</extension>
<extension>.png</extension>
<extension>.bmp</extension>
</restrictedExtensions>
</processor>
</uiUpload>
</processors>
<pipelines>
<getMediaStream>
<processor type="Validations.Compression.ImageCompression, Custom.Validations" />
</getMediaStream>
</pipelines>
<settings>
<setting name="Media.MaxImageSizeInDatabase" value="600KB" />
<setting name="Media.Resizing.Quality" value="72" />
</settings>
</sitecore>
</configuration>
Error with empty values of Width and Height
Finally fixed the issue. The problem was that I had to "unblock" the jpegtran.exe file. That's it.
We are experiencing cpu problems on our production servers. After profiling with the jetbrains cpu profiler, we have noticed that some functions in the assembly Sitecore.Analytics were executed.
This is somewhat strange because we have disabled all analytics related configuration in de config files.
After looking into the /sitecore/admin/showconfig.aspx we noticed that there are still a lot of Sitecore.Analytics related configurations in this config while these are deactivated in our config files.
For example
In the file /App_Config/Include/EventHandlers.config the configuration looks like this:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<events timingLevel="custom">
</events>
</sitecore>
</configuration>
When looking into the showconfig.aspx it looks something like this:
<events timingLevel="custom">
<event name="forms:save"/>
<event name="item:saved">
<handler type="Sitecore.Analytics.Data.Items.ItemEventHandler, Sitecore.Analytics" method="OnItemSaved"/>
<handler type="Sitecore.Analytics.Automation.Data.Items.ItemEventHandler, Sitecore.Automation.MarketingAutomation" method="OnAutomationStateChanged"/>
</event>
<event name="item:deleted">
<handler type="Sitecore.Analytics.Automation.Data.Items.ItemEventHandler, Sitecore.Automation.MarketingAutomation" method="OnAutomationStateChanged"/>
</event>
<event name="media:request">
<handler type="Sitecore.Analytics.Media.MediaRequestEventHandler, Sitecore.Analytics" method="OnMediaRequest"/>
</event>
</events>
Does anyone has an idea why these are still returning in the showconfig.aspx?
Is there a way to fully delete/disable the sitecore analytics module?
Yes. Rename the 3 configuration files for Sitecore.Analytics in your /App_Config/Include directory to something other than *.config
The 3 files are:
Sitecore.Analytics.config
Sitecore.Analytics.ExcludeRobots.config
Sitecore.Analytics.RobotDetection.config
(could vary a little bit by version, but they all start with Sitecore.Analytics).
Rename them to something like:
Sitecore.Analytics.config.disabled
Sitecore.Analytics.ExcludeRobots.config.disabled
Sitecore.Analytics.RobotDetection.config.disabled
(could vary a little bit by version, but they all start with Sitecore.Analytics).
Until sitecore version 72, there are only 3 files with Sitecore.Analytics prefix. In version 75, there are 17 and in version 8 there are 20 config files with Sitecore.Analytics prefix.
I used to confirm with sitecore support that you can change the setting of Analytics.Enabled in Sitecore.Analytics.config will disable Analytics
<setting name="Analytics.Enabled" value="false" />
Or only rename one file Sitecore.Analytics.config which contain this setting.
Did you try to User WFFM ?
There also analytics part:
Sitecore.WFFM.Analytics.config
and disabling it causes this fault:
22992 14:49:10 WARN Value cannot be null. Parameter name: owner
Exception: System.ArgumentNullException Message: Value cannot be null.
Parameter name: owner Source: Sitecore.Kernel at
Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String
argumentName) at Sitecore.Diagnostics.Log.Warn(String message,
Object owner) at Sitecore.WFFM.Core.Extensions.Warn.IsNull(Object
obj, String name) at
Sitecore.WFFM.Analytics.AnalyticsTracker.get_SessionId() at
Sitecore.Form.Core.FormDataHandler.ExecuteSaveActions(ID formId,
ControlResult[] fields, ActionDefinition[] actions) at
Sitecore.Form.Core.FormDataHandler.ProcessData(SimpleForm form,
ControlResult[] fields, ActionDefinition[] actions)
So it cannot be disabled.
I'm trying to set up ASR up to email scheduled reports, but this is the error message I see in the log files.
Exception: ASR.Reports.Items.Exceptions.DatabaseNotFoundException
Message: Exception of type 'ASR.Reports.Items.Exceptions.DatabaseNotFoundException' was thrown.
Source: ASR.Reports
at ASR.Reports.Scanners.DatabaseScanner.get_Database()
at ASR.Reports.Items.QueryScanner.Scan()
at ASR.Interface.Report.Run(Object[] parameters)
at ASR.Commands.ScheduledExecution.runReport(Item item, Boolean force)
at ASR.Commands.ScheduledExecution.<>c__DisplayClass4.b__1(Item i)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at ASR.Commands.ScheduledExecution.EmailReports(Item[] itemarray, CommandItem commandItem, ScheduleItem scheduleItem)
This doesn't make much sense since I'm able to generate reports through the admin interface.
In my ASR config
<setting name="ASR.ConfigurationDatabase" value="master"/>
In my Sitecore Analytics file
<scheduling>
<agent type="Sitecore.Analytics.Tasks.EmailReportsTask, Sitecore.Analytics" method="Run" interval="1:00:00">
DatabaseName>master
In my connection strings config, (which I know works because everything else is working)
<add name="master" connectionString="..." ... />
What am I missing?
ASR will use the ContentDatabase. When you run the report manually, you're running in the context of the "shell" site and it will default to master. When run as a scheduled task, the site will be "scheduler" which has no content database defined by default.
Try adding the following to a config file:
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site name="scheduler">
<patch:attribute name="content">master</patch:attribute>
</site>
</sitecore>
</configuration>
Openly wondering if this is an issue to address back with the ASR module.