-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
Which version of ProcessWire do you use? Do you use any modules or custom code, which could interfere there? Especially things that manipulate the session. Session extends Wire and Wire does have a public function addHookAfter(), so there's really not much to break on the way as long as $this->session is intact.
- 4 replies
-
- api
- post request
-
(and 1 more)
Tagged with:
-
Another form same problem. This time it's a FormBuilder generated form. I use this in a module to generate a frontend form entry list / single view. FormBuilder itself does use the same syntax for generating it's own entry view, so FormBuilder is broken, too. $form = $this->forms->get($name); foreach($form->entries()->get($entryID) as $key => $value) { $field = $form->get($key); // returns null for every nested field }
-
This module does provide two different added functionalities to FormBuilder. 1. The module does allow users to set default "From" email addresses for emails send to administrators. There's a global address, which is set in the modules settings, and a additional field in the settings for "Send an email to administrator(s)", where one can set a form specific emailaddress to override the global one. Both of those are overridden if you chose to use the "Email from field" setting and the returned value is not blank. 2. The module does add an additional syntax for the textfield where administrator emails are set. If you have a pagefield in your form, where one can choose from the potential users, that should be emailed about your form submission, you don't need to write extensive conditional lines like this: personInCharge=SomeUser?someuser@example.com personInCharge=AnotherUser?anotheruser@example.com You can simply add a email field to the template of those users and use the email provided there. !personInCharge?email The syntax says get the user(s) from the field "personInCharge" and send email(s) to the addresses provided by the "email" field of the selected page. https://github.com/LostKobrakai/FormBuilderEmailExtentions Thanks to madeprojects.com for letting me share this. They'll pay the time I spend to build it.
-
Now you only have to convince Ryan to use this for Hanna Code, so we don't need to have two big ace installations
-
Seems like it's not insertBefore per se. I could get the fieldset by using numeral keys on all the children and insertBefore() on the fieldset does work as expected. var_dump($form->children[1]->children[3]->id); // "fieldsetEmail" var_dump($form->get('fieldsetEmail')); // null There's just something with getting the fieldset that just does not work.
-
Using Processwire with Open Cart (or other applications)
LostKobrakai replied to icreation's topic in API & Templates
Based on your error you're expecting processwire to be here. /home/opencart/public_html/catalog/view/theme/default/template/processwire/index.php That's your problem at least for relative urls. Includes always start from the file their in, not from any index.php, which would reside in the root folder calling that file. What error did you get for the absolute path?- 11 replies
-
- developer api
- other applications
-
(and 1 more)
Tagged with:
-
Cannot republish users without password change
LostKobrakai replied to Ivan Gretsky's topic in General Support
I really feel the exact opposite way. You are trying to stuff a permission decision (is the user allowed to do something based on payment) into something that limits viewability but does not change the permissions of a user. The right way to go would much rather be something like a role "has_payed", which can get permissions like "can access feature X", "can access feature Y". If you're later getting to a stage of different subscriptions you can easily modify it to have roles like "has_payed_model_basic", "has_payed_model_advanced" and reuse all the permissions you used before, without even the need to touch you code. -
Importing Markdown text to PW pages....
LostKobrakai replied to GuruMeditation's topic in General Support
Then you should really take a look at the repos of ProcessRecipes on GitHub. -
make pw variables available in custom script
LostKobrakai replied to helmut2509's topic in API & Templates
See the last post here: https://processwire.com/talk/topic/5857-using-pages-in-custom-function/#entry88975 -
Importing Markdown text to PW pages....
LostKobrakai replied to GuruMeditation's topic in General Support
I don't want to sound rude, but copy paste? A more complex solution would be like the ProcessRecipes site works, which reads the markdown directly from files. This either has to be a one-time-import or all the files have to be available all the time, but that wouldn't be easily searchable. -
That's really nice, especially to get through more complex ones you didn't write on your own. But to be the nitpicker: This regex isn't correct. The part before the @ is in fact technically case sensitive and additionally [a-z] does not include language specific unicode chars. So HansMüller@gmx.de would not be found / validated. The unicode chars wheren't valid before 2012 that's why there are still lots of old regex examples out there, but now one should account for these. I'd think especially older people, wanting to get to know this internet, will happily use those in their emailaddresses if the emailprovider does allow those chars. I've also seen a help thread (i think somewhere on github) where a employee could not register, because his company worked with case sensitive emails, so the lowercase one didn't get to his inbox.
-
Cannot republish users without password change
LostKobrakai replied to Ivan Gretsky's topic in General Support
I just tried to see if I've the same problem, but in the current dev there's no setting to un-/publish a user, even with advanced mode enabled. So maybe it's because Ryan never anticipated this to be used. To circumvent the issue you could maybe use a additional role, which you set/unset for users. -
Questions about ProcessWire for building a Magazine
LostKobrakai replied to elmago79's topic in Getting Started
I'll just answer these one by one. It depends. You should always test updates locally before deploying it to the server, so you see if something isn't working on a newer version. It's still the work of the modules creator or the community to fix issues if present, so it's kinda the same principle as with wordpress. But you'll most likely not need as much plugins as for wordpress and more than that, you'll most likely won't need it for remodeling core cms functionalities but rather for smaller enhancements. There's also a compatibility list for each module in the modules directory and most likely a dedicated forum thread to each module, where you can always seek support. ProcessWire is quite easy to update. There's now even a module from Ryan, that does backup the database and the old wire/ directory for you. As your site and the cms are in seperate directories an update also can't change stuff from your site, so with the database backup and the wire/ directory you can always roll back if something broke. ProcessWire can easily handle lots of users. It has lot's of great caching methods build in and you could even buy procache which works on the .htaccess level to even bypass php (only useful for static sites) You can have as many templates as you need. It really depends on your usecases and on your way of handling templatefiles. You can use markdown with any textarea inputfield of processwire. Markdown is parsed by a textformatter and therefore isn't dependent on the editor. If you don't like CKEditor maybe have a look at this fresh addition to community modules: https://processwire.com/talk/topic/9164-release-inputfield-ace-extended/ -
Do you mean sort=-sort is not just reverting the order, but mixing it up?
-
I don't know exactly, but does sort=sort not sort by the order of pages are in the pagetree? sort=created would sort by creation date. Also there shouldn't be a problem if children() returns the right order as child() internally calls children() and just returns the first page if there are children.
-
Does $page->children also show the children in the wrong order? Does explicit sorting work there?
-
Cannot republish users without password change
LostKobrakai replied to Ivan Gretsky's topic in General Support
This would mean, that you have to insert the password every time you save a user, which is definitely not the case. The "real" password isn't even stored in the db, so there's no way to pre-populate the password field with a value, thus it has to have a blank state, where it won't trigger a database comparison / save. Just un-/publishing a user should normally not intrude this behavior, at least in my opinion. -
Cannot republish users without password change
LostKobrakai replied to Ivan Gretsky's topic in General Support
I think this is not intended. I'd try to create a user manually in the admin, give it a password and check if this triggers the same behavior. -
It's not only the same error in the log, but you're also doing the same thing wrong. You can't use $pages in functions because of variable scope. ProcessWire makes these object automatically available for the scope of the templatefiles, but inside a function is a new scope, so you need to either redefine the variable itself or use a function to get the object. // Template scope $id = 15; // simple variable, defined by you $pages = $pages; // the pages object, defined automatically by processwire function something(){ // this is now a new variable scope // neither $pages nor $id are available here. // the api variables are not a special global variable $pages = wire('pages'); $pages->find(""); // OR just wire('pages')->find(""); } It's the same reason, why you can't use $pages in modules. $page/$pages and the other variables are just convenient to use in templates. Everywhere else you need to call them differently.
-
I've a small problem with insertBefore. Somehow it's not working, while I can't see what could be wrong. I'm hooking the FormBuilder Interface and "form_emailForm" is correctly changed to 50% width. If I plainly add the additional field I see it below the whole interface, but if I use insertBefore it's not even to be found in the markup. Also $form->get("fieldsetEmail") does return null, even though this is the parent InputfieldWrapper of form_emailFrom. PW Version is the 2.5.20 public function addEmailField($event) { $form = $event->return; $field = $form->get('form_emailFrom'); $field->columnWidth = 50; $additionalField = $this->modules->get("InputfieldEmail"); $additionalField->columnWidth = 50; $additionalField->attr('id+name', 'form_defaultEmailFrom'); $additionalField->attr('value', $form->defaultEmailTo ? $form->defaultEmailTo : ''); $additionalField->label = $text; $additionalField->description = $text2; $form->insertBefore($additionalField, $field); }
-
@Soma That's a hell of a lot better than regexr. Especially seeing the groups in matches is a really nice feature.
-
Why isn't there a option for semicolons as seperators?
-
This could even sport a "preview" instead of the plain hanna code.
-
I get the same error for 2.5.18.
-
I know that and have it enabled, but the "busy" people of us maybe don't enable that, but would still happily answer, if someone is asking for their opinion / knowledge.