-
Posts
1,360 -
Joined
-
Last visited
-
Days Won
49
Everything posted by flydev
-
Convert Pages with image field to php array / json
flydev replied to pwFoo's topic in General Support
Check @abdus's answer and the comment from @Macrura just before : -
Hi, Is your webiste files placed under the `/usr/local/apache/htdocs` folder ? If yes, change the directive `AllowOverride None` to `AllowOverride All` from the Apache config file then restart Apache service: `sudo service apache2 restart` DocumentRoot "/usr/local/apache/htdocs" <Directory "/usr/local/apache/htdocs"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # # AllowOverride None AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> Edit: make sure you load the `rewrite` apache module : `sudo a2enmod rewrite`
-
Hi, I don't know if this question is ironically made for your self or if is a real one. Anyway just incase, the answer is easy: Simply add a single character. Always use === instead of == (or !== instead of !=) when comparing so if the types differs PHP will not attempt conversions and will return FALSE. Do not use the == until is really required, knowing what you are doing. Charts: https://github.com/sentientmachine/php_equality_charts
-
he haven't been able to find one. What about using the built-in user management ? Users could be customer, sellers or admins, you can do what you want. What specificity are you talking about this "membership" related module ?
-
Query on feature related to supporting displaying external content
flydev replied to Arunesh Dutta's topic in General Support
Hi and welcome to the forum. Your question is pretty vague. But yes, it will allow it if you write the code for it. The API will help you interacting with the backend easily. Also if the given external service has an API to fetch content from, then the process is more than easy (following their documentation). There is an idea for interacting with another ProcessWire site with the API : -
I was exactly thinking about that some days ago but I still can't find the time to do tests.
-
Hi, look at join-monster (Stem) or DataLoader (Facebook) to solve the N+1 query problem.
-
Welcome to the forum @PTRRR If you run `heroku logs --tails|grep "code="` and navigate with your browser inside your backend to trigger the error, is there an output ? How do you manage your sessions (session handler like MemCachier) ?
-
Hi, instead of `$sanitizer->pageName()` use `$this->sanitizer->pageName()` inside your hooks.
-
I fully understand, same thing here and I still don't know how it really work.. I can use, modify or compile it but not write a single SCSS, LESS or whatever file.. ! I first put my hand into theses things recently with the AdminThemeUikit and AdminThemeBoss. But once you get it, I must admit that they are usefull. A small advice to get started with theses things, take a look there from @Noel Boss : https://github.com/noelboss/AdminThemeBoss#modify-yourself Anyway, great addition, thanks again ?
-
passing variable to hook not working with _GET Variables?
flydev replied to Peter Troeger's topic in API & Templates
You should install TracyDebugger asap and then replace all your `echo` with `bd($your_var)` call, it will be easily for us to help you and for you to debug your code. Your hook is working fine on my side. Comment this line `// if($event->object->name == 'job_titel_und_nummer') {` and try again. -
Really great ! Thanks for sharing ! Is there a SCSS version of it ?
-
passing variable to hook not working with _GET Variables?
flydev replied to Peter Troeger's topic in API & Templates
Do you have installed TracyDebugger ? What's your ProcessWire version ? $jobID = 0; $jobID = wire()->input->get->job; bd("wire() : $jobID"); $jobID = 0; $jobID = $wire->input->get->job; bd("$wire : $jobID"); $jobID = 0; $jobID = $input->get->job; bd("$input : $jobID"); -
What say the line FILE in the module's information ? If it say nothing then rename the folder `GoodNews` to `ProcessGoodNews` and click on `Submit` on your module page, if still nothing, take a look at your database if there is any trace, on table `modules` and remove the corresponding entry of the module.
-
lol so easy @adrian I missed this feature ? edit-ot: really.. what a crazzy job with tracy...
-
In admin.php file : /** * Hook : * Add FieldtypeDecimal to compatible fieldtypes of * a FieldtypeFloat when a superuser need to change the type * of a float field. * * https://modules.processwire.com/modules/fieldtype-decimal/ * https://processwire.com/talk/topic/7542-development-fieldtypefloat-fieldtypedecimal/ * */ $wire->addHookAfter('FieldtypeFloat::getCompatibleFieldtypes', function($event) { if(!$this->modules->isInstalled('FieldtypeDecimal') || !$this->user->isSuperuser()) return; $return = $event->return; $return->set('FieldtypeDecimal', $this->modules->get('FieldtypeDecimal')); $event->return = $return; });
-
passing variable to hook not working with _GET Variables?
flydev replied to Peter Troeger's topic in API & Templates
$jobID = $wire->input->get->job; More infos : @BitPoet I think he is outside template -
[SOLVED] add Hook to set default Dropdown-Select in form
flydev replied to Peter Troeger's topic in API & Templates
I understand now what you are trying to achieve. try that : $mypage= $pages->get(1036); $wire->addHookBefore('InputfieldPage::render', function($event) use(&$mypage) { if($event->object->name !== 'job_waehlen') return; $inputfield = $event->object; $selectfield = $inputfield->getInputField(); $selectfield->addOption($mypage->id, $mypage->title, array('selected' => 'selected')); }); -
BitPoet is right but there is a subtlety. Actually you do not need to implement ConfigurableModule because when you use a MyModuleConfig.php along the module file, this new class extend the ModuleConfig class and thus you don't need to implements the ConfigurableModule or other configuration-specific code ! Your module IS configurable at that point. So regarding your fields configuration, it should work and if is not loading, I bet that a uninstall of the module and a Modules > Refresh and/or removing File Compiled/cache then re-installing the module will do the trick. Enjoy ?? !
-
[SOLVED] add Hook to set default Dropdown-Select in form
flydev replied to Peter Troeger's topic in API & Templates
Hi, you have to assign a page. $wire->addHookAfter('InputfieldPage::processInput', function($event) { if($event->object->name == 'job_waehlen') { bd($event->return->value); // return 1019 (my test id page) $event->return->value = $this->pages->get(1); // will set you parent tree bd($event->return->value); // return 1 (root page) } }); PS: bd() call come from TracyDebugger -
Check for value existence in a repeater (within a repeater) without a loop?
flydev replied to a-ok's topic in API & Templates
Hi, without a loop, you could use selector subfields to find your options like the following: $page->repeater->find("sub_repeater.field=value"); So for you code : $option_name = $p->shop_product_options->find("shop_product_options_option.global_text={$option['name']}"); if(is_null($option_name) || !count($option_name)) { continue; } else { // do stuff }- 1 reply
-
- 1
-
Hi, read that:
-
Amazing.. ?? I just asked to my boss if he still has something, telling me that all the things came to the trash some time ago, but he told me that he still have a Sinclair ZX-81 with 1KB of RAM and an 16KB RAM extension (http://oldcomputers.net/zx81.html). I will have an answer tomorrow. If you're interested, just tell me. For the C64, it look like we can find some machines here in France. After the hardware part ?