Plone comments from anonymous - comments

My plone server working under plone 4.3.2
At site#1 I enable discussion at control panel. Then anonymous user input comments at site with filled field "Name", comment posted with Name "Anonymous", but not "Name".
At another site#2 on this Plone server all OK - field "Name" of comment publishing at site.
I tested this with product plone.app.discussion version 2.2.8 and 2.2.10.
In ZMI in folder portal_scins/custom is records folder_listing, folder_tabular_view, logo.png, main_template, public.css.
If I editing file comments.pt in folder .../plone.app.discussion-2.2.8-py2.7.egg/.../browser/ for sample line 74 from 'says:' to 'says_:' publishing at site not changing.
But at site#2 publishing at site changing: writing 'says_:'
Earlier I install product quintagroup.plonecomments, but now it is deleted.Early all worked OK without activate quintagroup.plonecomments.

Related

ASP.NET Core 6 MVC : adding identity failing

I'm using VS 2022, ASP.NET Core 6 MVC and Microsoft SQL Server 2019 (v15).
Git project: [https://github.com/Wizmi24/MVC_BookStore]
I'm trying to add --> new scaffolded item --> identity.
Default layout page, override all files and mine Data context
when I click add, I get this error:
There was an error running the selected code generator:
'Package restore failed. Rolling back package changes for 'MyProjectName'
I cleared NuGet Package cache as I saw it may help, but all it do is just prolong and this same error is visible after trying to install Microsoft.EntityFrameworkCore.SqlServer, which is installed. I checked the packages and made sure they are the same version (6.0.11).
I cloned your project to test, and the problem you mentioned did appear. Not sure why, but I finally got it working by updating the NuGet package:
I updated the two packages Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.Relational to version 7.0.1 (you need to pay attention to the sequence when updating), then add scaffolded Identity, and I succeeded.
You can try my method, if the Identity is successfully added, but the following exception is encountered at runtime:
You need to add builder.Services.AddDbContext<MyBookContext>(); before
builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<MyBookContext>();
MyBookContext is the Data context class selected when you add Identity:
In addition, if there is a 404 error in your area routing, you can refer to this document to modify it.
Hope this can help you.
Edit1:
I think it might be a problem caused by naming duplication. Please try to change the name of the context generated by Identity.
As you can see, the ApplicationDbContext generated by Identity is consistent with the ApplicationDbContext namespace in your MyBook.DataAccess:
So naming the same will cause conflict:
So you need to change the naming to avoid conflicts. For example:
builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(
builder.Configuration.GetConnectionString("DefaultConnection")
));
builder.Services.AddDbContext<ApplicationDbContextIdentity>();
builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContextIdentity>();
Edit2:
As I mentioned in the original answer, if you get a 404 error, you can try to refer to this link to fix the area routing.
The easiest way is to directly change the routing settings in Program.cs:
app.MapAreaControllerRoute(
name: "Customer",
areaName: "Customer",
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
Then add the Area property to the controller:
[Area("Customer")]
public class HomeController : Controller{}
There seems to be a problem with your Repository.cs, so I changed the Index to only output a string to test the result.
public string Index()
{
return "success";
}
Test Result:
If your Repository.cs also has problems when you test it, you can make a new post for everyone to help you fix this problem(Because this question strays so far from your original question, one post is better off addressing only one question).
Good Luck.

How I can configure admin component to show that fields with `name_convertion` from `personName` to `person_name`

I have a problem with name_convertion and Admin Component
When I turn on name_converter to name_converter: 'Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter' as documentation says ( https://api-platform.com/docs/core/serialization#name-conversion ), in api response I see properies like that: person_name, instead defined in entity: personName and its ok, but admin component won't show that fields ( person_name ):(
When I turned off, in API response I see personName and admin component show that fields
Where/or how I can configure admin to show that fields?
This was a bug. It has been fixed in API Platform Core (the server-side component) 2.2.6 (released today!): https://github.com/api-platform/core/pull/1919
Upgrading should fix this problem. If it's not the case, please open an issue.

CKFinder - 404 Error when attempting an upload

I set my CKFinder/CKEditor integration as follows:
var editor = CKEDITOR.replace('editor11');
CKFinder.setupCKEditor(editor, null, { type: 'Files', currentFolder: '/archive/' });
The CKFinder popup displays and I go to the upload tab and am able to select an image. When I click "Send it to the Server" I get the following error:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure that
it is spelled correctly.
Requested URL: /ckfinder/connector
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET
Version:4.7.2110.0
I get a similar error when I click "Browse Server" on the Image Info tab. I see nothing else in the documentation that is required. Please help me to solve this issue
Edit:
Adding connectorPath fixed it. The path is different on our DEV server than my local machine, where it works already.
CKFinder.setupCKEditor(editor, {
connectorPath: '/brainsbeta/ckfinder/connector'
});

Magento : How to hide the default Store View code from the url

The site has 2 languages: English and French, represented by 2 store views. French is the default one. For our SEO efforts we need to have the following urls:
French - http://www.domain.com/category/product
English - http://www.domain.com/en/category/product
System -> Configuration -> Web -> Add Store Codes to URL is the all or nothing setting. We just need to turn it off for the default store only.
I’ve done a lot of searching through the forums and wiki but there’s nothing on the subject.
Please any sugestions?
Finnaly i solved this magic probleme , i hope that's save others persone here is the details :
1- Download the zip existe in this page : https://github.com/Knectar/Magento-Store-Codes
2- unzip the file and put the folder called "Knectar" in {app/code/community/} and Knectar_Storecodes.xml file in {app/etc/modules}
3- In your backoffice go to "System > Tools > Compilation" and click the rebuild button
4- always in backoffice got to "System > Configuration > Web > URL options" and set the attribute "and default store view" to No and save the configuration
5- Clear your cach magento and enjoy your application :) .
I had the same problem and I have developed an extension for that.
It is available on GitHub: https://github.com/jreinke/magento-hide-default-store-code
I didn't find a quick solution to your problem, but I see that's possible through 2 steps :
1 / Using the advise commented by #user3154108 and trying this tip https://magento.stackexchange.com/questions/8126/store-code-in-url-for-every-store-view-except-for-default
2 / For SEO SITEMAP, it's possible to override the following file
app/code/core/Mage/Sitemap/Model/Sitemap.php
public function generateXml()
{
...
}
and replace the default store code by NULL.
For more details try to look at this post : http://alanstorm.com/generating_google_sitemaps_in_magento
I was having the same problem and I had already selected to not show store code in url in the config. I also didn't want to install an extension just to handle something this minor. Here's my EASY solution:
Copy app/code/core/Mage/Catalog/Block/Widget/Link.php to app/code/local/Mage/Catalog/Block/Widget/Link.php
Search for (line 91 in Magento 1.7.x / line 100 in Magento 1.9.x)
$this->_href = $this->_href . $symbol . "___store=" . $store->getCode();
And modify to
$this->_href = $this->_href;
Upload and save your changes and you'll now not have your widget (dynamically) inserted links getting appended with ?___store=default.
Credit: DesignHaven
Under System -> Configuration -> Web -> URL Options you
change "Add Store Code to Urls" to "NO" as on the attached screenshot

Magento - Product by country using IPaddress

I want to add a radio button with the following option
Show product in
> United States
> International
> Both
Upon selection the product will show on the front end for the appropriate customers using IP detection
I google it and i found one plugin
http://www.magentocommerce.com/magento-connect/Vinay.N+%28+Tumkur%2CKethohalli%29/extension/2413/product-by-ipaddress
But it is not compatible with Magento ver. 1.5.0.1. Please help. Thanks
Setup two websites for your shop, where 'website' does not have to mean a different URL, just, internally for Magento it is a 'website'. For this example use codes 'usd' and 'row'.
Use GeoIP in Apache if you can install packages on your distro. If not then you can use PHP geoip plugins - again see what is recommended for your setup.
To send your customers to what Magento thinks is a website, with the site visitor not knowing they have been 'redirected'. In your index.php you will need something like:
$country=$_SERVER['GEOIP_COUNTRY_CODE'];
switch ($country)
{ case "CA":
case "MX":
case "US":
$_SERVER['MAGE_RUN_CODE'] = "usd";
$_SERVER['MAGE_RUN_TYPE'] = "website";
break;
default:
$_SERVER['MAGE_RUN_CODE'] = "row";
$_SERVER['MAGE_RUN_TYPE'] = "store";
}
Mage::run($_SERVER['MAGE_RUN_CODE'], $_SERVER['MAGE_RUN_TYPE']);
For your products, in the website tab, select the websites that you want the product to show in. Put a tick in both boxes or just one depending on how it is to show.
This will be easy to update compared to a 'hacked' solution.
Update.
The sleekest way to run GeoIP is as an apache module. Here is the link to the instructions and download:
http://www.maxmind.com/app/mod_geoip
If installing an Apache module is not possible due to shared hosting or operating system flakiness then the PHP module can be used instead. Full instructions and download for geoIP can be found here:
http://www.maxmind.com/app/php
Once installed swap out $country=$_SERVER['GEOIP_COUNTRY_CODE']; for the following:
include("geoip/geoip.inc");
// Uncomment if querying against GeoIP/Lite City.
// include("geoipcity.inc");
$gi = geoip_open("/your/path/to/geoip/GeoIP.dat",GEOIP_STANDARD);
$country=geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
More help on GeoIP is available from the above links.

Resources