J4 Issue ? ?
avatar david19161
david19161
18 Mar 2021

Steps to reproduce the issue

  1. Ensure you are not logged into site administrator
  2. Login to front-end of site as super user
  3. Edit any article and click Image in the CMS Content dropdown to bring up Media Manager
  4. Select and attempt to insert any image

Expected result

Image is inserted into content

Actual result

Nothing happens.
Using browser console in Firefox shows [HTTP/1.1 403 Forbidden]

System information (as much as possible)

Joomla_4.0.0-beta8-dev-Development-Full_Package - 2021-03-18

Additional comments

Works if you are logged into administrator backend
Same happens on latest versions of Chrome, Edge

avatar david19161 david19161 - open - 18 Mar 2021
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Mar 2021
avatar drmenzelit drmenzelit - change - 18 Mar 2021
Labels Added: J4 Issue
avatar drmenzelit drmenzelit - labeled - 18 Mar 2021
avatar rdeutz rdeutz - change - 18 Mar 2021
Labels Added: ?
avatar rdeutz rdeutz - labeled - 18 Mar 2021
avatar PhilETaylor
PhilETaylor - comment - 19 Mar 2021

hmmm... this echos some of the media bugs I reported, and others fixed, before...

#32259
#30005

related?

avatar david19161
david19161 - comment - 20 Mar 2021

Yes Phil, I saw your previous reports and wondered why the issue had been closed

This particular issue is maybe caused by the administrator path being hard-coded into the iamge select endpoint as follows:

file : media/system/js/fields/joomla-image-select.js
line : 195

const apiBaseUrl = ${Joomla.getOptions('system.paths').rootFull}administrator/index.php?option=com_media&format=json;


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32734.
avatar PhilETaylor
PhilETaylor - comment - 20 Mar 2021

that was changed in some places like build/media_source/system/js/fields/joomla-field-media.w-c.es6.js in https://github.com/joomla/joomla-cms/pull/30617/files

Maybe one instance was missed.

Paging @SharkyKZ who worked on that.

avatar Jenniline
Jenniline - comment - 22 Mar 2021

Hi @PhilETaylor and @david19161. My name is Jenniline Ebai I am applying for GSOCI 2021 under the Media Manager project. I notice that this issue directly relates to the project. I will like to work on this issue and use it to get acquainted with the Media Manager Project. I have read the discussion and I have tried to understand what this issue means please can you give me some description and direction to work on this issue? Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32734.

avatar PhilETaylor
PhilETaylor - comment - 22 Mar 2021

This should be a release blocker like the others were. (@infograf768 @wilsonge)

avatar PhilETaylor
PhilETaylor - comment - 22 Mar 2021

@Jenniline welcome. This might not be a good starting issue as it has history, everything you need to know is linked in this issue, and the two previous issues that have already been resolved. It might be that @SharkyKZ missed one instance of the hard coded path. I steer clear of JS in Joomla so I'll be of no help here :)

avatar Jenniline
Jenniline - comment - 22 Mar 2021

okay Thanks

avatar infograf768 infograf768 - change - 23 Mar 2021
Labels Added: ?
avatar infograf768 infograf768 - labeled - 23 Mar 2021
avatar infograf768
infograf768 - comment - 23 Mar 2021

@david19161
You are correct. Taking off administrator/ in that line solves the issue.

Edit: also wrong path

diff --git a/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js b/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js
index b15f09b..fbc3807 100644
--- a/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js
+++ b/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js
@@ -191,5 +191,5 @@
     }
 
-    const apiBaseUrl = `${Joomla.getOptions('system.paths').rootFull}administrator/index.php?option=com_media&format=json`;
+    const apiBaseUrl = `${Joomla.getOptions('system.paths').baseFull}index.php?option=com_media&format=json`;
 
     Joomla.request({

PR welcome.

avatar rdeutz rdeutz - change - 23 Mar 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-03-23 19:21:08
Closed_By rdeutz
Labels Added: ? ?
Removed: ? ?
avatar rdeutz rdeutz - close - 23 Mar 2021
avatar rdeutz
rdeutz - comment - 23 Mar 2021

Closing because we have a PR #32825

avatar rdeutz rdeutz - change - 23 Mar 2021
Labels Removed: ?
avatar rdeutz rdeutz - unlabeled - 23 Mar 2021

Add a Comment

Login with GitHub to post a comment