Revo Discussions & Support - MODX Community Forums <![CDATA[help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]>
I just upgraded a neglected site from modx 2.1.6 to 2.7.0. I was getting some php errors before the upgrade that left the front end up, but the manager broken. I found out my shared host upgraded their php, which may have triggered the issues. I backed up my site and did the upgrade. It went smoothly, and everything works fine now, except I get the error: "Warning: constant(): Couldn't find constant 32759 in /home1/mysite/modx/core/model/modx/modx.class.php on line 690" at the top of all of my public pages.

I suspect this is because there have been so many revisions since 2.1.6 and my database probably didn't quite match up.
My only addons are wayfinder and spform. Both are up to date.

cPanel 70.0 (build 66)
Apache 2.2.34
PHP 7.0.33
MySQL 5.6.41-84.1
Perl 5.26.0

What can I do to fix this?

-Dan]]> Wed, 20 Feb 2019 01:06:18 +0000
<![CDATA[on PHP 7.3 FastCGI produces a warning in modcachemanager.class.php on line 580]]>
Now FastCGI/apache is producing the following warning:

[Tue Jan 08 ....] [fcgid:warn] [pid .....] [client] mod_fcgid: stderr: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/..../htdocs/core/model/modx/modcachemanager.class.php on line 580, referer: ....

Should I be concerned?]]> Wed, 20 Feb 2019 12:55:38 +0000
<![CDATA[Bring list of events by user for mycalendar extra]]>

Now, I want to to see a list of events for the user logged in, that means if I logged in with my username, I just see my own events. I'm not sure how myCalendar extra is doing the relation with the user, cos' in the sql table there are id, title, description, start, end, all_day, properties, and not an id_user

I have this, with this code I can see all the events but not by user.

 <h2>List of events</h2>


My question is, how can I know what events are from which user?
Thanks]]> Wed, 20 Feb 2019 06:19:50 +0000
<![CDATA[Update error 2.7.0]]>
Hello everybody. There was a problem when I was upgrading to 2.7.0.
I have a simple application that consists of an index, a login and a private panel.
The problem appeared when I upgraded to version 2.7.0. The application is modifying the url when I'm logged in to the private panel.
For example, if the url to an avatar is "myapp.local / assets / component / myapp / images / site / avatar.png" the system is changing the url to " /site/avatar.png ".
This also happens with the stylesheets css and js scripts, like this:
"myapp.local / assets / component / myapp / css / boostrap.css" changes to "myapp.local / controlpanel / assets / component / myapp / css / boostrap.css"
"myapp.local / assets / component / myapp / js / jquery-1.11.0.js" changes to "myapp.local / controlpanel / assets / component / myapp / js / jquery-1.11.0.js"

Does anyone have any idea what's happening?
Thank you!]]> Mon, 18 Feb 2019 08:48:17 +0000
<![CDATA[Articles Tag Output]]>
Been using MODX for a number of years now, and after being away for a while, I've decided to come back and use it for a client project.

I'm outputting tags from articles using [[+article_tags]], which seems to be working as intended. One problem I'm finding is that I'm getting a comma (,) delimiter after every item output.

I've tried changing the output properties of the articletags TV to 'delimiter' and then leaving it blank. Is anyone able to help please?

Many Thanks]]> Mon, 18 Feb 2019 09:32:30 +0000
<![CDATA[FormIt emailTo set through Hook with Multiple Values does not work]]>
Hi there!

I've created a FormIt hook that sets the value of the emailTo parameter based on another parameter:
FormIt call:
[[!FormIt? emailTo=`[[+emailRecipient]]`]]

$hook->setValue('emailRecipient', '');
$email_recipient = $hook->getValue('emailRecipient');
// returns

This code above works like a charm (obviously the FormIt call has a bunch more parameters). The emailTo parameter gets set to without any issues.

However, if I change the snippet to multiple addresses that are comma-separated (with or without a space), I get an error:
$hook->setValue('emailRecipient', ',');
$email_recipient = $hook->getValue('emailRecipient');
// returns,

As you can see in the code above, both emails get passed into the emailRecipient field as it displays within the server error log.
However, I'm getting the following error in the MODX error log:
(ERROR @ : 552) [FormIt] An error occurred while trying to send the email. You must provide at least one recipient email address.

You must provide at least one recipient email address even though 2 addresses are being provided. I've tried it with 3 email addresses and got the same result, but again, this worked perfectly fine when there's only one email address.

This leads me to believe that the issue comes from FormIt, but this is where I'm stuck and coming here for help.

Finally, the weirdest thing of all is that if I put multiple email addresses in the emailTo parameter of the FormIt call, it works!
[[!FormIt? &emailTo=`,`]]

Go figure.

Any leads or insight would be greatly appreciated.

Thank you!
jm]]> Sat, 16 Feb 2019 09:45:48 +0000
<![CDATA[4th hacking of whole server through modx image-related plugin]]>
For the 4th time, my whole VPS server, including all the other sites on it, have been infected with viruses through Modx sad

The previous time, it was through Image+ issue, which was fixed in an update of that plugin.

Now it was through the Gallery Plugin with Modx 2.7.0 :
Shell:PHP/Filehacker.A (Shell)
Shell:PHP/Filehacker.A (Shell)

Modx used to be safe in the past, but now I am afraid to use it for security reasons.
Unlike wordpress, it doesn't even have a security or malware scanning plugin.

Please help wih this !]]> Thu, 14 Feb 2019 08:53:45 +0000
<![CDATA[Extjs / modExt: How to add special validation logic into save/update actions via Ext.override?]]> "A record with similar information was found: [firstname] [lastname] [email]. If you're sure the record you're saving is unique, click OK. Otherwise, click cancel."

What I've arrived at as a possible solution is to override the and classes to add a handler to the save button to call a custom validation method. What I'm stuck on is figuring out the code needed to continue the normal process should the user press "OK." Here's an outline of the create override:

(function() {
	var origGetButtons =;

	Ext.override(, {
	    getButtons: function (cfg) {
	    	var items = origGetButtons.apply(this, arguments);
	    	items[0].handler = this.validateContact;
	    	return items;
	    validateContact: function () {
	    	// Ajax request to connector/processor with validation php, returning 'unique' or 'confirm' (with additional data)
	    		// code to continue process???
	    	} else {
				Ext.Msg.confirm('Validation Message','The record you are saving may be a duplicate. Continue?',function(e) {
	                if (e == 'yes') {
	                    // code to continue process???
	                } else {
						// not sure if anything is needed here if staying on the current create/edit page

For reference the subclass (from modext/sections/resource/create.js): = function(config) {
    config = config || {};
        url: MODx.config.connector_url
        ,formpanel: 'modx-panel-resource'
        ,id: 'modx-page-update-resource'
        ,which_editor: 'none'
        ,action: 'resource/create'
    	,buttons: this.getButtons(config)
        ,components: [{
            xtype: config.panelXType || 'modx-panel-resource'
            ,renderTo: config.panelRenderTo || 'modx-panel-resource-div'
            ,resource: 0
            ,record: config.record
            ,publish_document: config.publish_document
            ,show_tvs: config.show_tvs
            ,mode: config.mode
            ,url: config.url
    getButtons: function(cfg) {
        var btns = [];
        if (cfg.canSave == 1) {
                process: 'resource/create'
                ,reload: true
                ,text: _('save')
                ,id: 'modx-abtn-save'
                ,method: 'remote'
                ,keys: [{
                    key: MODx.config.keymap_save || 's'
                    ,ctrl: true

            text: _('cancel')
            ,id: 'modx-abtn-cancel'
            text: _('help_ex')
            ,id: 'modx-abtn-help'
            ,handler: MODx.loadHelpPane
        return btns;

My sense is there's a simple solution here...any pointers are much appreciated!]]> Mon, 11 Feb 2019 06:25:49 +0000
<![CDATA[MODX 3: Would you like this feature?]]>
If you get a moment, please share your opinions about this feature request on the Github issue:

### Summary
It would be great if MODX 3 could include configuration options in the installer. These options would provide a richer starting point for developing a project with MODX.
For example, if selected, a multi-lingual site could be configured automatically while MODX is installed. A similar concept to what the MultiLangSetup extra does. Or if a blog is needed, it could be configured automatically using the appropriate extras which would be downloaded during setup.

### Why is it needed?
There is no one size fits all and that's especially true with how customizable MODX is. This is certainly one of it's main strengths. However, it can be daunting for newcomers to be presented with a blank slate. In addition, for MODX veterans it would be incredibly useful to have time-saving functions such as these.
I believe this would help to grow the community by making the first few steps more user friendly.

### Suggested solution(s)
I propose this is added via configuration scripts in the MODX installer. Required extras for the various setups would be downloaded on demand. For example, a multilingual site might need Babel and LangRouter installed and then contexts/settings configured.

This change to the installer only adds extra options and if not selected, a blank MODX site would be installed exactly the way it is currently.

* What do you, the community, think about the proposition?

* If for it, what configuration setups should be included?

* Which extras should be used for each option?

]]> Mon, 11 Feb 2019 04:16:13 +0000
<![CDATA[What happens with MODX on Github.]]> But everyone can contribute to the development of our CMS.

At the moment, the project on Github 1,073 stars - add a star, it is not difficult!
Currently created 557 issue -
See the activity for the month: - everything came to life and became active!

Closed: 62 issue
Merged into branches: 51 Pull request from 65.
Open PR: 14 pieces.
Participated in the development: 12 authors

Look at the readiness of new releases:

Follow the link, choose an issue for yourself: there are old issues from 2009 - they just need to be reproduced (maybe after years it’s no longer relevant and has been fixed in new releases. If so leave a comment with a screen or mark that everything is ok) or if you have a solution to this problem or add a new functionality - add PR!

We need help from each of you! Take some free time - make the PR!

- we will make our CMS better!
- add new functionality
- quickly close the old shoals
- close the 2nd branch and speed up the output of the 3rd branch from alpha!

Thanks in advance for your contribution to the development!]]> Mon, 11 Feb 2019 03:58:35 +0000
<![CDATA[Issue with HTTPS and .htaccess]]>
I'm trying to have all the variations of my URL rewrite to "". For this I added these 3 lines to my .htaccess file:
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$$1 [L,R=301]

Now both "" and "" rewrite to "".
This is good, but "" still gives a "This Connection Is Not Private" error page.
I've tried un-commenting these lines, but that didn't help:
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} (.+)$
RewriteRule ^(.*)$$1 [R=301,L] .

Am I using this wrong? Or is there another way?

Thanks in advance for your help!
]]> Fri, 08 Feb 2019 08:08:38 +0000
<![CDATA[API (PHP) Method to Generate Confirmation Dialog?]]> Fri, 08 Feb 2019 04:15:32 +0000 <![CDATA[How to limit one session at a time for a single account?]]> I have a simple question/request.

Currently MODX allows many login sessions for the same user account.
(logging in from different browsers/devices on the same account doesn't end the previous session)

Is there any way to limit the session to only one active at a time (per user), and how?

I'm using the Login extra for MODX, the logging would only be for (protected) front-end context (default web).
Perhaps some kind of hook for the login, snippet or plugin would do it, but I don't have much experience with it.

I apologize for not having much knowledge on the matter.
Thank you for your time, I'm new to MODX but its a really great tool.]]> Thu, 07 Feb 2019 03:16:45 +0000
<![CDATA[How to prevent specific user groups from being listed in the "Resource Groups" tab of a resource ?]]>
I think I want to do something that it's not possible with Modx but I am not sure.

I have a super-admin user group that can associate resources to the "super admin restricted" resource group to hide them to all other users.

I have also 3 basic user groups, and each of these have an associated resource group to only view the resources from their group. The resources of these 3 user groups are managed by a sub-admin (not part of the super-admin group) that can assign one resource to any of the 3 associated resource groups of these 3 basic user groups.

But I don't want this sub-admin group to be able to set the "super admin restricted" resource group, I only want them to be able to list or set the resource groups he has access to.

Unfortunately, I can't find what I want in the ACL.

If I give to this sub-admin group the ability to associate a resource to a resource group, they can do it with all resource groups. I can't prevent them to associate a resource with the "super admin restricted" resource group.

It does not seem to be very complicated, it's a common use case.

Any idea of what I'm doing wrong?]]> Wed, 06 Feb 2019 07:00:10 +0000
<![CDATA[modx_session is marked as crashed and should be repaired]]>
[ERROR] /usr/sbin/mysqld: Table './modx_session' is marked as crashed and should be repaired

Hi, have somebody idea what makes modx_session as crashed? After repair table its same, even drop table and create new is error still written to /var/log/mysql/mysql_safe_error.log]]> Wed, 06 Feb 2019 06:26:02 +0000
<![CDATA[1&1 (IONOS) hosting issue]]>
I developed I site locally and was then asked to install it onto a 1&1 hosting account.
I uploaded the files and db etc - all fine. But if I try and create a resource, I cannot save it.
Now can I create a new snippet or chunk.
Has anyone come across hosting issues with 1&1 and any remedies to the problem?

Andy]]> Wed, 06 Feb 2019 06:23:45 +0000
<![CDATA[Any way to remove all resource group access controls for super users?]]>
I was customising access to resources as per:

I dragged all resources to a new group called 'editables'. Assigned my new editor and super users to the group, now I have no access at all to any resources!

Is there any way to just remove all changes I have made and just start from scratch again?]]> Tue, 05 Feb 2019 07:14:30 +0000
<![CDATA[Manager Issues after Migration (MODX 2.7.0)]]> After running setup the log-in window appears but after logging in I get this error message (I have changed identifying folder names with generic ones):
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (CST6CDT) at position 3 (6): Unexpected character in /home/user/public_html/manager/controllers/default/dashboard/widget.grid-online.php:25 Stack trace: #0 /home/user/public_html/manager/controllers/default/dashboard/widget.grid-online.php(25): DateTime->__construct('CST6CDT') #1 /home/user/public_html/folder/core/model/modx/moddashboardwidget.class.php(251): modDashboardWidgetWhoIsOnline->render() #2 /home/user/public_html/folder/core/model/modx/moddashboardwidget.class.php(123): modDashboardWidgetInterface->process() #3 /home/user/public_html/folder/core/model/modx/moddashboard.class.php(83): modDashboardWidget->getContent(Object(WelcomeManagerController)) #4 /home/user/public_html/manager/controllers/default/welcome.class.php(73): modDashboard->render(Object(WelcomeManagerController)) #5 /home/user/public_html/folder/core/model/modx/modmanagercontroller.class.php(155): WelcomeManagerController->process(Array) #6 /home/ in /home/user/public_html/manager/controllers/default/dashboard/widget.grid-online.php on line 25
In the manager folder, the php_errorlog gives this message (again, I have changed identifying folder names with generic ones):
[04-Feb-2019 11:16:35 CST6CDT] PHP Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (CST6CDT) at position 3 (6): Unexpected character in /home/user/public_html/manager/controllers/default/dashboard/widget.grid-online.php:25
Stack trace:
#0 /home/user/public_html/manager/controllers/default/dashboard/widget.grid-online.php(25): DateTime->__construct('CST6CDT')
#1 /home/user/public_html/folder/core/model/modx/moddashboardwidget.class.php(251): modDashboardWidgetWhoIsOnline->render()
#2 /home/user/public_html/folder/core/model/modx/moddashboardwidget.class.php(123): modDashboardWidgetInterface->process()
#3 /home/user/public_html/folder/core/model/modx/moddashboard.class.php(83): modDashboardWidget->getContent(Object(WelcomeManagerController))
#4 /home/user/public_html/manager/controllers/default/welcome.class.php(73): modDashboard->render(Object(WelcomeManagerController))
#5 /home/user/public_html/folder/core/model/modx/modmanagercontroller.class.php(155): WelcomeManagerController->process(Array)
#6 /home/ in /home/user/public_html/manager/controllers/default/dashboard/widget.grid-online.php on line 25
Any help is very much appreciated!]]> Tue, 05 Feb 2019 04:30:25 +0000
<![CDATA[Best way to create a blog with MODx]]>
what is currently the best way to create a blog with MODx: Articles? Or getResources? What can you recommend?

Thank you and best regards,
Michael]]> Tue, 05 Feb 2019 12:36:18 +0000
<![CDATA[Setup missing bracket error when upgrading to 2.7]]>
So try again running set up. click to install and get a white screen.

Try uploading 2.6.5 again and running that setup. Same white screen.

Now have to restore the backup.

Tried the same on a second site and succeeded with no error message. Then tried on a third site, and have the same problem as the first.

Any advice on how to consistently upgrade to 2.7 from 2.6.5 without getting error messages about apparently missing brackets?]]> Fri, 01 Feb 2019 11:44:14 +0000