Azure publish errors for custom html helper - azure

I am very new to Microsoft Azure, but when I publish my application and try to access it, I get this error -
error CS1928: ‘System.Web.WebPages.Html.HtmlHelper’ does not contain a definition for ‘SportSiteHref’ and the best extension method overload ‘mySports.Helpers.HtmlHelpers.SportSiteHref(System.Web.Mvc.HtmlHelper)’ has some invalid arguments
I am obviously using HtmlHelpers, with this example.
<div class="padding-top padding-bottom">
<img class="bottom-panel-image responsive" src="/images/fullsite/HomePagePromo.png" alt="" />
</div>
This works locally and when I FTP to my live site like I have been doing for years.
Why does Microsoft Azure trap this as an error?

Related

NgFor not rendering new items added in array in a chrome extension build using angular 11

I am developing a chrome extension using angular 11. For building the project I have used custom-webpack and provide the entry point to background.ts as suggested in blog: Link.
<div class="container">
<span><b>Steps</b></span><br>
<span *ngFor="let step of steps;">
{{step}}<br>
</span>
</div>
I am using the above snippet of code in my app component template. Items are getting pushed to steps array at runtime, If I log the steps array in console, I am seeing that items are being pushed to array but not rendered to UI.
Please help me to find out like how I can make use of ngfor in the chrome extension. For developing the extension, I referred to the above said link.

Call qweb template inside odoo data template

I am trying to make an OTP service for login and registration. So I made a module for otp service that is working fine. But here for UI, I made and template that should be called inside the login page to visible the otp box and otp send button. Please see samplae code bellow:
<templates xml:space="preserve">
<div name="otp_service" t-name="bulk_sms_otp_service.otp_service">
<h1>Hello world</h1>
</div>
</templates>
Now I am trying to call this template inside login view. Please see bellow:
<odoo>
<template id="custom_login" name="Custom login" inherit_id="web.login">
<xpath expr="//p[hasclass('alert-success')]" position="after">
<t t-call="bulk_sms_otp_service.otp_service"/>
</xpath>
</template>
</odoo>
But this call not working. Giving me an error like:
External id "bulk_sms_otp_service.otp_service" not found
I don't know what's wrong with my code or I am wrong. Please Help me to solve this issue.
You can read at Helpers:
in which case templates stored in the database (as views)
You can deduct that some qweb templates are not stored in database.
You can also read in the JS QWeb Template Engine documentation that templates defined in files listed in the qweb entry in each module manifest are loaded when the web client starts.
When odoo process custom_login template it will try to retrive the bulk_sms_otp_service.otp_service template view_id (From ir.model.data) to read the corresponding template and it will fail because custom_login templates is not stored in database (In ir.ui.view).

Netlify honeypot attribute missing on deployment

I have a django website that I'm using the django_distill app to generate a static site which I'm deplying to netlify. I've decided to add a bot protection field to a form (https://docs.netlify.com/forms/spam-filters/#honeypot-field ). When I run the site locally I see
<form data-netlify="true" name="consultdocs" netlify-honeypot="BOTFIELD" action="/contact/" id="form" method="post" novalidate="novalidate"> <input type="hidden" name="csrfmiddlewaretoken" value="rdKh4K2zu9T96aEUO9exSv3QCAm5w">
<input id="id_BOTFIELD" name="BOTFIELD" type="hidden">
....
When I deploy to netlify:
<form name="consultdocs" action="/contact/" id="form" method="post" novalidate="novalidate"><input type="hidden" name="form-name" value="consultdocs"> <input type="hidden" name="csrfmiddlewaretoken" value="GNnbYgQu6vLduSpWEswAVXfEx">
<input id="id_BOTFIELD" name="BOTFIELD" type="hidden">
....
I no longer see the :
netlify-honeypot="BOTFIELD"
attribute. Does netlify remove this?
In short: Yes, netlify removes this field.
I thought initially it's because of the missing data-prefix but netflify removes it independently if it's used with data-netlify="true" data-netlify-honeypot="BOTFIELD OR just netlify="true" netlify-honeypot="BOTFIELD.
I did a quick isolation test to ensure django is not doing some magic. So I simply used two static html files and pushed them to netlify:
https://gallant-edison-bf9c5f.netlify.com/index.html (w/o data attribute)
https://gallant-edison-bf9c5f.netlify.com/index2.html (w/ data attribute)
In both cases it disappears. You can check the respective source code for both files here:
https://github.com/christoph-kluge/netlify-example
I assume that netlify is parsing your HTML code during deployment and is adjusting it. Additionally netflify already checks if a specific post is a potential bot and drops those requests for you. So they need to do something with those fields.
Hope this answers your question.

IIS Http status issues

The iis server in production is behaving differently from my pc for my restful api project. There are two below issues.
1) if the endpoint doesn’t exist under the website (eg https://xxx/website/invalidapi/), production iis is returning http status 404 instead of local pc is returning 500.
Below is error msg.
*<div class="content-container">
<h3>HTTP Error 404.0 - Not Found</h3>
<h4>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
</h4>
</div>
<div class="content-container">
<fieldset>
<h4>Most likely causes:</h4>
<ul>
<li>The directory or file specified does not exist on the Web server.</li>
<li>The URL contains a typographical error.</li>
<li>A custom filter or module, such as URLScan, restricts access to the file.</li>
</ul>
</fieldset>
</div>*
If the website/application doesn’t exist (eg, https://xxx/invalidwebsite/api/), production iis is returning http status 500 instead of local pc returning 404.
Below is 500 error msg
*<div id="header">
<h1>Server Error</h1>
</div>
<div id="content">
<div class="content-container">
<fieldset>
<h2>500 - Internal server error.</h2>
<h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>
</fieldset>
</div>
</div>*
Is there some configuration in production iis to behave that way?
2) I am implementing iis rewrite rule to my website, the rule is to redirect the request with invalid (non-existing website) to default another website.
It is working well in my local pc. But in production iis, it is not redirecting and returning http status 403 for invalid website. If I tested to a test (existing site), it can rewrite correctly.
Is it due to the same reason as above? Kindly advise how I can fix ? Thanks.

Azure AD B2C strips html tags from Custom UI template

While trying to customise the unified (Sign In & Sign Up page), I have this simple HTML in my unified.html template (fragment):
<div class="col-4 login-box gradient-background">
<div>
<h1>WELCOME TO<br/>SuperFancyProductName<sup>®</sup></h1>
</div>
<div id="api" data-name="Unified"></div>
</div>
However, when Azure AD B2C renders the Sign In page, the element is stripped of from inside the h1 element, with this result (fragment):
<div>
<h1>WELCOME TO<br>SuperFancyProductName®</h1>
</div>
In our case, this does not allow us to properly align the ® symbol.
Is there any documentation on what tags are allowed in the template html and how this template transformation actually works?
There is a subset of HTML that is allowed but is not documented.
It looks like the superscript tag is not allowed here. For reference, see this Github issue.
The docs team is still working on an update to show what's allowed.
You can upvote some of the requests in User Voice or create your own request: https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/31173091-improve-the-tag-filtering-on-the-b2c-custom-ui-tem

Resources