Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Customizing plone.links.favicon View for ISenaiteCore Interface #2499

Open
conroyke56 opened this issue Feb 21, 2024 · 8 comments
Open

Comments

@conroyke56
Copy link

Description

Encountered a BadRequest error when attempting to customize the plone.links.favicon view associated with senaite.core.interfaces.ISenaiteCore via portal_view_customizations in a Plone and SENAITE installation running in Docker on Linux. The system reports that the ID for the customization is already in use, which prevents saving any modifications.

Reproduction guide

  1. Navigate to portal_view_customizations.
  2. Locate plone.links.favicon (senaite.core.interfaces.ISenaiteCore) and open it.
  3. Click on the [Customize] button.
  4. Encounter the BadRequest error indicating an ID conflict.

Observed behaviour

Received a BadRequest error message indicating that the ID "zope.interface.interface-plone.links.favicon" is already in use, which prevents the customization from being completed.

Expected behaviour

The customization interface should allow modifications to the plone.links.favicon view without any ID conflicts, enabling users to save their changes successfully.

Versions

  • OS: Linux
  • senaite.core: master
  • senaite.impress: master
  • senaite.core.listing: master
  • senaite.core.supermodel: master

Traceback

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 288, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module plone.app.customerize.browser, line 50, in customizeTemplate
  Module plone.app.customerize.registration, line 189, in customizeTemplate
  Module plone.app.customerize.tool, line 30, in addTemplate
  Module OFS.ObjectManager, line 350, in _setObject
  Module OFS.ObjectManager, line 142, in checkValidId
BadRequest: The id "zope.interface.interface-plone.links.favicon" is invalid - it is already in use.
@Lunga001
Copy link
Contributor

Hi @conroyke56
Maybe you can have a look at and not sure if you got to this point

Click [Customize] and change the two instance of the text $portal_url/+plone+senaite.core.static/images/favicon.ico to point to the favicon in the custom folder, $portal_url/portal_skins/custom/favicon.ico and save

also note if you haven't already default branches are 2.x

@conroyke56
Copy link
Author

default branches are 2.x

Yes, this is a new install, using docker.
currently on 2.6.0 for all.

Click [Customize] and change the two instance of the text $portal_url/+plone+senaite.core.static/images/favicon.ico to point to the favicon in the custom folder, $portal_url/portal_skins/custom/favicon.ico and save

that is exactly what i am trying to modify.
When I hit customise, i get the error, so no ability to modify it.

I have looked at plone documentation, and there's nothing helpful.

https://4.docs.plone.org/manage/troubleshooting/exceptions.html#badrequest-the-id-xxx-is-invalid-it-is-already-in-use

solution: "Not really sure why this happens."
Try portal_catalog rebuild as a fix.

catalog rebuild did not help.

@Lunga001
Copy link
Contributor

Lunga001 commented Feb 21, 2024

Maybe try on a new site or instance, even new container. It works for me

@conroyke56
Copy link
Author

conroyke56 commented Feb 21, 2024

are you running all 2.6?
can you first try changing the plone.links.favicon (senaite.impress.interfaces.ISenaiteImpressLayer)

<tal:favicon define="portal_url view/site_url">
    <link rel="shortcut icon" type="image/x-icon" tal:attributes="href string:$portal_url/portal_skins/custom/favicon.ico" />
    <link rel="apple-touch-icon" tal:attributes="href string:$portal_url/portal_skins/custom/favicon.ico" />
</tal:favicon>

then going back and seeing if you can customise the core? thats the only modification i have made within zope.
Changing it back made no difference, i still get the error.

@Lunga001
Copy link
Contributor

Our (senaite.impress.interfaces.ISenaiteImpressLayer)
image
and our (senaite.core.interfaces.ISenaiteCore)

<tal:favicon define="portal_url view/site_url">
    <link rel="shortcut icon" type="image/x-icon" tal:attributes="href string:$portal_url/++plone++bika.ui.static/assets/icons/favicon.png" />
    <link rel="apple-touch-icon" tal:attributes="href string:$portal_url/++plone++bika.ui.static/assets/icons/favicon.png" />
</tal:favicon>

@conroyke56
Copy link
Author

Just wound up a new instance. And same error for me.

Just to be clear. When you hit customise on the core, you can modify that code?

@Lunga001
Copy link
Contributor

Yes, I have created a new site and this also saves

<tal:favicon define="portal_url view/site_url">
    <link rel="shortcut icon" type="image/x-icon" tal:attributes="href string:$portal_url/++plone++bika.ui.static/assets/icons/analysisservice.png" />
    <link rel="apple-touch-icon" tal:attributes="href string:$portal_url/++plone++bika.ui.static/assets/icons/analysisservice.png" />
</tal:favicon>

image

@conroyke56
Copy link
Author

I've been experimenting further to understand the issue better, and it seems the solution might be simpler than I initially thought, although I could be overlooking something obvious. I initiated another instance and discovered I could modify the favicon without any problems.

However, the issue arises when I attempt to make changes to the favicon using Impress. After making changes there, I'm unable to go back and make any further modifications to the favicon for the core system.

Below are the screenshots illustrating what I'm trying to achieve:

This is what I aim to modify:
list

Here, I go into the system to modify the core favicon:
senaite core interfaces ISenaiteCore

After saving these changes and then trying to modify it again via Impress, I encounter the following error:
error impress

I suspect this issue might be related to the process of saving changes, which seems to leave the code in a modified state. as per the first screenshot. Is there a way to commit the changes, other than hitting save?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants