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
Pages for process modules don't have a title in specific situations #1462
Comments
@MoritzLost I can't seem to duplicate the issue here. When I install any module that specifies the 'page' property in its getModuleInfo, and I'm in a language other than default, the created page still gets its default language populated. This is because ProcessWire's module installer sets the language to default before it calls a module's ___install() method. Something I can spot in that module you mentioned is that it's not extending the Process classes |
@ryancramerdesign Thanks for the reply! /**
* Called by ProcessWire during module installation.
*
* @return void
*/
public function ___install()
{
// save an installation message to force creation of the cache-control log file if it doesnt exist yet
$tools = $this->modules->get('CacheControlTools');
$tools->logMessage($this->_('ProcessCacheControl installed successfully. Creating the dedicated log file.'));
return parent::___install();
} But it's still not working correctly. In my test setup, there are two languages: German ( Could you take another look? Any other implementation errors in my module that might be causing this? |
@MoritzLost can you replicate the issue if you comment out the install() method in /site/modules/ProcessCacheControl/ProcessCacheControl.module in line 264? Also, don't use ___install() method. |
@MoritzLost @matjazpotocnik I was able to duplicate this with ProcessCacheControl. While the install method should ideally be named |
Ryan, I asked Moritz to test with a reason: I can always replicate the issue IF this method is "active": public function install()
{
// save an installation message to force creation of the cache-control log file if it doesnt exist yet
$tools = $this->modules->get('CacheControlTools');
$tools->logMessage($this->_('ProcessCacheControl installed successfully. Creating the dedicated log file.'));
return parent::install();
} When I comment install() method, the issue is gone. I didn't dig further as I first wanted a confirmation of my findings. Now, with your fix in place, it works regardless of the presence of the install() method. |
@MoritzLost I confirmed Ryan's fix is working so I'm closing this issue. Please reopen if needed. |
@matjazpotocnik @ryancramerdesign Sorry for the late reply, I was out sick for a couple of weeks. Thanks for the fix! So should I still adjust my module? I.e. change the |
@MoritzLost If your module extends another than you want to use whatever the parent module is doing. So if the parent module defines an The reason why you would want to call If the module does not extend another, then you can choose whether you want to implement install() or ___install(). I'm not sure it matters, as I don't know of anyone hooking module install methods, but I usually go with ___install() just in case. :) |
@ryancramerdesign Thanks for the explanation. I've updated my module accordingly: https://github.com/MoritzLost/ProcessCacheControl/releases/tag/1.1.1 |
Short description of the issue
This is a follow-up to this forum thread. Here's a summary of the issue:
Expected behavior
When installing a Process module with a
page
key, ProcessWire should set the title of the generated page in all languages (or at least in the default language), regardless of the account language of the user installing the module.Actual behavior
The process page only get's a title in the account language of the user installing the module, which may not be the default language.
Screenshots/Links that demonstrate the issue
Screenshot of a process module page with an empty title in the setup menu:
Suggestion for a possible fix
Upon installation, ProcessWire should check if the site has multiple languages and set the title in each language automatically.
Steps to reproduce the issue
Setup/Environment
ProcessWire: 3.0.185
PHP: 7.4.25
The text was updated successfully, but these errors were encountered: