? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
12 Jan 2018

Pull Request for Issue #19360 .

Summary of Changes

allows to load a module via loadmodule content plugin with this syntax

{loadmoduleid 12345}

Testing Instructions

edit an article and add this :
{loadmoduleid 12345}

where 12345 is the id of a module published etc
or click the insert module button
and click on the desired module title item

Expected result

the module id 12345 is loaded inside the article

Actual result

not available

Documentation Changes Required

maybe

avatar alikon alikon - open - 12 Jan 2018
avatar alikon alikon - change - 12 Jan 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jan 2018
Category Libraries Front End Plugins
avatar Bakual
Bakual - comment - 12 Jan 2018

If you use a new plugintag loadmoduleid, you can imho get rid of the id: prefix since we expect an ID anyway (eg just {loadmoduleid 1234}). The prefix is needed if you use the existing plugintag loadmodule (eg {loadmodule id:1234}).

avatar alikon alikon - change - 12 Jan 2018
Labels Added: ?
avatar alikon
alikon - comment - 12 Jan 2018

i hope that way is more clear

avatar brianteeman
brianteeman - comment - 12 Jan 2018

ideally the xtd-editor plugin will use this new method

avatar Quy
Quy - comment - 12 Jan 2018

I prefer this syntax too {loadmoduleid 1234} without id:.

avatar Quy
Quy - comment - 12 Jan 2018

When the id does not exist:

PHP Notice:  Undefined variable: name in \libraries\src\Helper\ModuleHelper.php on line 739
PHP Notice:  Trying to get property 'module' of non-object in \plugins\content\loadmodule\loadmodule.php on line 233

When id exists, here is the output:

<div class="custom"  >
	</div>
avatar alikon alikon - change - 13 Jan 2018
The description was changed
avatar alikon alikon - edited - 13 Jan 2018
avatar alikon
alikon - comment - 13 Jan 2018

the syntax now is {loadmoduleid 1234} ie without id:
fixed the id not found issue
xtd-editor plugin is outside the scope of this pr

avatar brianteeman
brianteeman - comment - 13 Jan 2018

Not really out of scope as its the only complete way to answer the request in #19360

avatar joomla-cms-bot joomla-cms-bot - change - 13 Jan 2018
Category Libraries Front End Plugins Libraries JavaScript Front End Plugins
5cc1b00 13 Jan 2018 avatar alikon modal
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jan 2018
Category Libraries Front End Plugins JavaScript Administration com_modules Libraries JavaScript Front End Plugins
avatar alikon
alikon - comment - 13 Jan 2018

the module id is selectable from modal now
screenshot from 2018-01-13 10-28-29

avatar alikon alikon - change - 13 Jan 2018
The description was changed
avatar alikon alikon - edited - 13 Jan 2018
avatar Fedik
Fedik - comment - 14 Jan 2018

I still think you should not do SQL query in your new method getModuleById($id), and use $modules = static::load(); instead. See for example getModule().

Because 100 modules in article will produce 100 + 1 queries.

avatar alikon
alikon - comment - 14 Jan 2018

yes more clean now

62beaa9 14 Jan 2018 avatar alikon regex
23731bc 14 Jan 2018 avatar alikon cs
avatar smehrbrodt
smehrbrodt - comment - 15 Jan 2018

Thanks a lot for doing this!

About inserting the module ID in the editor: You implemented it that selecting the title would write the old loadmodule to the editor, and selecting the ID would write the new loadmoduleid.

I think this is confusing and most users would not see that the ID is even clickable. I would prefer to replace the existing title insertion with the module insertion and not offer two choices here. It doesn't break anything, nor does it change existing markup, it just changes newly inserted markup to use the ID.

avatar alikon
alikon - comment - 15 Jan 2018

for me in the 3.8.x series cannot be replaced, in 3.9.x or 4.x it can be, but
I will leave this decision to the mantainers

avatar brianteeman
brianteeman - comment - 15 Jan 2018

Its a new feature not a bug fix so it would be in 3.9 anyway.

From !y perspective there is no b/c break. Thanks existing method will still render the module and the new replace!want method will do it in a better way that is more sustainable

781ddf3 15 Jan 2018 avatar alikon cs
avatar alikon
alikon - comment - 15 Jan 2018

in the modal when the title is selected the new syntax {loadmoduleid 12345} is written
the module id is no more selectable in modal to avoid confusion as requested
the old syntax {loadmodule mod_custom,Title} is still available only in article editing not in modal

avatar alikon alikon - change - 15 Jan 2018
The description was changed
avatar alikon alikon - edited - 15 Jan 2018
avatar Quy
Quy - comment - 15 Jan 2018

Using the modal, the id is not included {loadmoduleid }.

avatar alikon
alikon - comment - 15 Jan 2018

i've missed the echo sorry 😅

avatar Septdir Septdir - test_item - 16 Jan 2018 - Tested successfully
avatar Septdir
Septdir - comment - 16 Jan 2018

I have tested this item ✅ successfully on 16ecfff


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

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 16 Jan 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jan 2018

I have tested this item ✅ successfully on 16ecfff


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Jan 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jan 2018

Ready to Commit after two successful tests.

avatar pavluk
pavluk - comment - 16 Jan 2018

I have tested this item ✅ successfully on 16ecfff


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

avatar pavluk pavluk - test_item - 16 Jan 2018 - Tested successfully
avatar rdeutz rdeutz - change - 16 Jan 2018
Labels Added: ?
avatar mbabker mbabker - change - 17 Mar 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-03-17 15:55:56
Closed_By mbabker
avatar mbabker mbabker - close - 17 Mar 2018
avatar mbabker mbabker - merge - 17 Mar 2018
avatar mbabker
mbabker - comment - 17 Mar 2018

Merged correctly to 3.9 via 1711cfb

avatar joomlabeat
joomlabeat - comment - 27 May 2018

Just arrived here as I needed to get modules by Id and wrote the method in JModuleHelper - I see it's on its way now :)

avatar rubygirlusa
rubygirlusa - comment - 31 Oct 2018

this isn't working
just upgraded to 3.9 and noticed this feature change however
when selecting module in article - {loadmoduleid 243} loads but then error displays & site is not visible
CALL TO UNDEFINED METHOD JOOMLA\CMS\HELPER\MODULEHELPER::GETMODULEBYID()

avatar ReLater
ReLater - comment - 31 Oct 2018

@rubygirlusa
I can't confirm your find.

Please try a re-update of 3.9.0 via Joomla! Update component (Upload & Update). It looks like your first one wasn't complete.

If the error persists open a new issue with step-by-step instructions to reproduce it.

avatar rubygirlusa
rubygirlusa - comment - 31 Oct 2018

reupdated 3.9.0 and still no change. Duplicating error is simple. Open Article, click MODULE (in editor), select module. {loadmoduleid 243} will then display correctly in the article in the admin area - once article is saved and viewed from front end - same error listed above(CALL TO UNDEFINED METHOD JOOMLA\CMS\HELPER\MODULEHELPER::GETMODULEBYID()) is displayed with 404 page.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Nov 2018

@rubygirlusa please open a new Issue as Comments on a closed one didn't get much Notice.
Reporting Bugs.

avatar Fedik
Fedik - comment - 1 Nov 2018

@rubygirlusa it looks like you have overridden class ModuleHelper, by some extension,
that override should be removed or updated

Add a Comment

Login with GitHub to post a comment