Jump to content

dotnetic

Members
  • Posts

    1,037
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by dotnetic

  1. Thanks. I did not use $modules->get("EmailNewUser"); because I previously changed the module to autoload, but after the updates this setting was gone. Thanks for the hint. I am using latest ProcessWire Dev version from Github which is 3.0.80 And my settings look like in my screenshot. I am on a Windows System if that matters. But I don't think so. After going into the pass field and saving the settings my bar dump now shows the same settings as yours. But these settings seem to be not available by default.
  2. Adrian, thank you for your support. The new version is generating the password fine. But now the problem is back that no email is being sent when I create the user via the API Here is the code, that I used to test this: $new_user = new User(); $new_user->of(false); $new_user->addRole("editor"); $new_user->email = "someone@somewhere.com"; $new_user->name ="someone-somewhere.com"; $new_user->sendEmail = true; $new_user->save(); In a fresh PW 3.0.80 install I tried the latest version 1.1.2 and the output of d($fields->get('pass')->minlength); is still "null". If I output only the field, I get the following data (see screenshot).
  3. Hey @adrian. The password generation in the latest version does not work correctly. It only generates passwords that are 1 char long. In line https://github.com/adrianbj/EmailNewUser/blob/master/EmailNewUser.module#L158 you generate the new password. The output of bd($this->wire('fields')->get('pass')->minlength); is null. If I try to insert a number instead, it works. $newPass = $this->passwordGenerator(6, false, $this->buildPasswordCharacterSets($this->wire('fields')->get('pass'))); I get back to the other questions soon.
  4. Here is another one: If I create a user via the API and use $new_user->sendEmail = true; an email is not being sent. Here is the code that I execute via Tracy console: $new_user = new User(); $new_user->of(false); $new_user->addRole("editor"); $new_user->email = "aceman3000@gmail.com"; $new_user->name ="aceman3000-gmail.com"; $new_user->sendEmail = true; $new_user->save();
  5. Another bug: If you choose to re-send the welcome message, a new password is not generated.
  6. Hey @adrian. I installed the new version from Github. There is a small bug that I found: If I create a user and don't send him a welcome message, then the next time I edit this user (maybe I want to add some details to custom fields) the label of the email function reads "Re-send welcome message" although I did not send an email yet. Feature request: If "Generate password" is checked, and the "PasswordForceChange" module is installed, the checkbox "Force password change on next login" should be checked, because it is not save, to send passwords via email. But maybe that is just my opinion. What do you think of that?
  7. Hey @adrian. Thanks for your quick reply No they did not show even when the option was checked. Switching the init function to a ready function fixes the problem. I also thought of doing this, but didn't do it. Now it is working fine I use the latest version from github = 1.0.5 and if I open the file in a texteditor or in my IDE then line 54 is the correct line. EDIT: Weird, on github it is line 55. Must be something in my editors. Regarding the output of line 72 (that was something that I added): bd($event->object->attributes["class"]); There is a problem with removing the required attribute from password fields. It gets removed, but if you accidentally enter something in the password field and then delete it, you can not submit the form, because the required attribute gets added back in. This is coming from the InputfieldPassword.js which gets added to the page. Starting in line 120 it reads $input.on('change', function() { var val = $(this).val(); if(val.length > 0) { $input.attr('required', 'required'); $confirm.attr('required', 'required'); } else if(!$(this).closest('.InputfieldStateRequired').length) { $input.removeAttr('required'); $confirm.removeAttr('required'); } }); So if the "Generate Password" Option is set, the script should not be executed or loaded. One approach would be, to remove the CSS class "InputfieldPasswordComplexify" so the script does not react to it. I tried to make a hook for this, but it does not work yet. Maybe you have some suggestions? Here is my hook in the ready function: $this->addHookBefore('InputfieldPassword::render', $this, 'removeComplexify'); and here the function protected function removeComplexify(HookEvent $event) { $f = $event->object; bd($f); $f->removeClass('InputfieldPasswordComplexify'); } I don't know what is wrong or if this is the right approach. I even tried to use addHookAfter, which also did not work. Maybe you have an idea?!
  8. Hi @adrian thanks for this great module. I want to always show the "Send welcome message" field/checkbox for new users, that I create in the admin. But this checkbox never shows. I filled out the email-address but it still does not show up. I unchecked the option "Automatic Email Send" in the modules settings, because I want to choose if a user should get a welcome email or not. Could this be because of the core version of PW that I am using? I am using 3.0.71 right now. I turned on ProcessWire debug now, and EmailNewUser triggers an error: Trying to get property of non-object in K:\xampp\htdocs\myproject\src\site\assets\cache\FileCompiler\site\modules\EmailNewUser\EmailNewUser.module on line 54 That line reads if ($this->wire('page')->process == "ProcessUser") $this->addHookAfter('ProcessPageEdit::buildFormContent', $this, 'addEmailFields'); I think the problem is $this->wire('page')->process == "ProcessUser" but I am not sure. Any suggestions?
  9. Hi @tpr. Do you know how to set another theme for Codemirror? If I use it, my HTML source code becomes unreadable of the theme (which seems to be moono-lisa).
  10. Maybe Magento 2 in conjunction with ProcessWire will fit your needs. Take a look at the post where I contributed a possible solution to get this working. If there are more people who are working with this approach, we get a nice bridge between the two systems.
  11. You can also include (bootstrap) ProcessWire into Magento.
  12. Hi @pandaman For one of my customers I made some basic experiments to connect the both systems together. Your arguments are valid. I also told him to combine the best of two worlds and let each system do what it's best for. What I can say right now, it is possible, but there might be pitfalls, that I didn't discover yet. One problem was the session management which caused conflicts so you have to modify it. Right now I have the following working solution (PW 3 and Magento 2.1): I installed Magento 2.1 in a "store" directory that lies right beside site and wire directories. I made a magento2-bridge.php in site/templates/ <?php namespace ProcessWire; require $_SERVER['DOCUMENT_ROOT'] . '/store/app/bootstrap.php'; use Magento\Framework\App\Bootstrap; class StoreApp { private static $instance; public static function get_instance() { if ( ! isset(self::$instance) && ! (self::$instance instanceof StoreApp) ) { self::$instance = new StoreApp(); } return self::$instance; } public $helper; public $quote; public $session; public $cart; public $customer; private function __construct() { $bootstrap = Bootstrap::create(BP, $_SERVER); $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); $this->customer = $obj->get('Magento\Customer\Model\Session')->getCustomer(); $this->quote = $obj->get('Magento\Checkout\Model\Session')->getQuote(); $this->helper = $obj->get('\Magento\Checkout\Helper\Cart'); $this->session = $obj->get('Magento\Checkout\Model\Session'); $this->cart = $obj->get('\Magento\Checkout\Model\Cart'); } } I had to modify the session management in Magento, so it stores its session variables in ProcessWires directory. I hope I remember this correctly: Change the Cookie Path in Magento @ Stores -> Configuration -> Web -> Defaut Cookie Settings to "/" (without the quotes) Change the save_path for sessions under store/app/etc/env.php 'session' => array ( 'save' => 'files', 'save_path' => $_SERVER['DOCUMENT_ROOT'].'/site/assets/sessions', At some point I changed the sessionAllow parameter of ProcessWire, but I don´t know if this is needed anymore. But for completeness, here is the code I used: $config->sessionAllow = function () { if (strpos($_SERVER['REQUEST_URI'], '/processwire/') === 0) { return true; } return false; }; Then in my site/templates/home.php I have the following code, to get data from Magento (like Customer data, what is in the cart, product information): require_once __DIR__ .'/magento2-bridge.php'; $store = StoreApp::get_instance(); $quote = $store->helper->getQuote(); $quoteitems = $quote->getAllItems(); $customer = $store->customer; bd($customer->getName()); foreach ($quoteitems as $item) { // Code to get contents per product bd($item->getName()); bd($item->getQty()); } If you are wondering what bd() means. It is a debugging output from Tracy Debugger for ProcessWire (recommended install). Why do I share this information here although it was very time-consuming and expensive to figure this out? Because I had great support from the PW community and want to give something back. If you make any progress with this, please try to do the same and share your findings with our lovely community.
  13. I want to trigger an action when I save my custom module configuration. Right now, I got the following code which is not working: public function ready() { $this->addHookAfter('Modules::saveConfig', $this, 'afterSave'); } public function afterSave() { $this->message("saved module config"); // Also I need the saved module settings here } I also need the values of the module configuration after saving, so I can trigger an action. Any ideas?
  14. +1 Displaying a changelog before upgrading a module or even the core is badly needed. Also the changelog should be visible everytime on a module detail page.
  15. @ryan Right now the view that shows translation files "Setup > Languages > German" is not very intuitive and confuses users and translators, because they are confronted with cryptic names (Textdomains) instead of clear to read names. How can we make it better? Add clear to read labels like the module name from modules and the filename without the path from other files (.php). The path information has to be more subtle, as it is not that important for most users Take a look at the first two entries compared to the lower two. This can be done very quickly by adding some styles. Either flexbox or floats would do the job. Here is what I did (just quick and dirty and not the best way) Changed order of the file path to last. Added CSS to InputfieldFileLanguageFilename description: <span class="InputfieldFileLanguageFilename description" style=" position: absolute; right: 0; padding-right: 10px; font-size: 13px; color: #ccc; ">/site/templates/main.php</span> What you think of that?
  16. @tpr With the new tablecellselection.js it works In my eyes, the Lightwire skin looks nicer than the default skin. Especially the design of the dropdowns and the icons. Can´t you update the default skin so it uses your styles? Maybe even publish it on the ckeditor.com site. The changes are subtle but noticable.
  17. Hello @tpr I have a problem with Pro Fields: Table in conjunction with AdminOnSteroids. If I use the Table Cells Selection Plugin or the Lightwire skin, the editing of the fields does not work as expected. I attached a screen-capture (with audio) to show the problem. I can export the fields if you want to recreate this. pro-fields-table-adminonsteroids.mp4
  18. Yes, i try to support all filterboxes. Sadly right now I am busy with some projects. Hope I find the time to finish this soon.
  19. Hey @tpr, I am working on some modifications so that the quick-filter works with ProcessWire´s design philosophy. Right now I got it working for AdminThemeDefault and AdminThemeReno. I am working on AdminThemeUikit compability, which needs some markup modifications. I attached some actual screenshots (AdminThemeUikit is stilll work in progress, so not the final output). What do you think of these modifications? Are you interested in merging them if I create a pull request?
  20. @Salemoche Obviously this is the same question you asked on http://stackoverflow.com/questions/43854601/css-is-not-updating-in-processwire. Maybe give me an upvote there if my solution helps you. Here is my answer again: This is most likely a problem with caching. Please read https://varvy.com/pagespeed/leverage-browser-caching.html for example, to understand what browser caching is and what task it accomplishes. On this page under "Common caching issue" you find your problem. If you are using Chrome, open the Dev Tools (F12) and under the Network tab check "Disable cache". In Firefox open the Firefox Toolbox (also F12) and under Settings > Advanced settings check "Disable HTTP-Cache if Toolbox is open" (I translated this from a german Firefox). After that make changes in your CSS file and reload the page. If your changes appear then you know you stumbled into one of the pitfalls of browser-caching. There are many strategies to deal with this "problem". Take a look at https://css-tricks.com/strategies-for-cache-busting-css/ for some solutions.
  21. @Nico Knoll Wenn du mir die Zugangsdaten gibst, würd ich das sogar ändern.
  22. @nickie Any update or showcase for the site?
  23. I think the two modules should be merged, as they both serve module specific tasks.
  24. Another problem, or maybe THE problem is, that you seem to not have GD lib installed. As you can see on https://processwire.com/about/requirements/ this is required. Install it, and I think your problem is gone.
  25. It seems like a permission problem with uploaded files so ProcessWire can´t access them.
×
×
  • Create New...