Kunena / Kunena-Forum

Kunena Forum - Forum / Bulletin Board / Discussions component for Joomla - This is the 6.x/5.x main development branch. Please do not open issues regarding earlier versions of Kunena
https://www.kunena.org
GNU General Public License v3.0
1.75k stars 814 forks source link

Error with custom SVG icons when using the New Topic menu item #9358

Closed rich20 closed 1 year ago

rich20 commented 1 year ago

To Reproduce

Actual result You get an error like this, if you click the menu item New Topic

Warning: DOMDocument::load(): I/O warning : failed to load external entity "/.../media/kunena/core/svg/penguin.svg" in /.../libraries/kunena/src/Icons/KunenaSvgIcons.php on line 76

The symbol shows correctly on all other places and when you navigate to a category and click on button New Topic, the icon is also displayed in the editor (see image). . Bildschirmfoto vom 2022-11-04 20-55-04

Additional context With Fontawesome or Images Legacy this problem not exist.

System information

Desktop

Ruud68 commented 1 year ago

Just tested this, sort of as your instructions are not correct / complete.

  1. copy ./media/kunena/topic_icons/default to ./media/kunena/topic_icons/test
  2. copy ./media/kunena/core/svg/arrow-clockwise.svg to ./media/kunena/topic_icons/test/user/svg
  3. open ./media/kunena/topic_icons/test/topicicons.xml
  4. change svg="exclamation" into svg="arrow-clockwise"

in aurelia template:

in Kunena configuration:

in category [X]:

in front-end

  1. login
  2. goto category [X]
  3. click new topic button

The arrow-clockwise.svg displays without error: image

rich20 commented 1 year ago

copy ./media/kunena/core/svg/arrow-clockwise.svg to ./media/kunena/topic_icons/test/user/svg

Yes, I know when the icon is also present in /media/kunena/core/svg it works. For your test, rename it, so that the icon is only present in .../topic_icons/test/user/svg. Then you will see the problem. It makes no sense to use the folder .../test/user/svg for self-created icons if in write mode they are not loaded from this folder.

rich20 commented 1 year ago

login goto category [X] click new topic button

Sorry, I had overlooked that. As I wrote, it works if you navigate to the category and click the New Topic button there. That's not the problem, the error occurs when you use the menu item New Topic at top.

Ruud68 commented 1 year ago

@rich20 is this now fixed with #9362

rich20 commented 1 year ago

Now only the default icons are loaded when you use the New Topic menu item. So it is mandatory to navigate to the category and use the button there if you want to see your own icons in write mode.

rich20 commented 1 year ago

Now only the default icons are loaded when you use the New Topic menu item. So it is mandatory to navigate to the category and use the button there if you want to see your icons in write mode.

Ruud68 commented 1 year ago

correct. That is because every category can have it's own set of icons, so when on new topic view there is no category selected. When no category is selected, what iconset should be displayed?

That is the question :), now it is set to select the 'default'.

As also said in the PR: when selecting a category with a different iconset then default, there should be javascript in place that requests the iconset and replaces the ones displayed in this view with the new ones... but that is a big change. that is why I pinged @xillibit on this.

xillibit commented 1 year ago

I had seen your comment on this, i think it should be done in K6.1

Ruud68 commented 1 year ago

agree, this is new functionality that requires javascript and also some new php functions in kunena. Maybe the logic (using ajax calls to dynamically change what is on the screen) can also be used in other areas of kunena: so we should keep that in mind :)

xillibit commented 1 year ago

I'am close this one now i have created this issue : https://github.com/Kunena/Kunena-Forum/issues/9374