-
Posts
1,489 -
Joined
-
Last visited
-
Days Won
43
Everything posted by gebeer
-
Hello, I'm getting a JS error in the admin backend when editing pages with template basic-page as non superuser: TypeError: a.ProcessPageList is not a function in InputfieldPageListSelect.min.js Investigating the JS, I found that the ProcessPageList function is not available on the page when I am logged in as a non superuser. The function is defined in /wire/modules/Process/ProcessPageList/ProcessPageList.min.js which is not loaded when logged in as non superuser. When logged in as a superuser, the file gets loaded. I have no fancy permission settings for that template for the role admin that the non superuser belongs to: This started happening on a site that is in development but online for some time now. I can't say which actions might have caused this. But it is a consistent error only for this one template. The site is running on 3.0.42 EDIT: The inputfield triggering the error is an image field (in fact there are 2 of them in that template) Any pointers to potential causes for this problem would be much appreciated. EDIT: The problem is not related to any file changes. When I run the same install with a DB backup, the error disappears. So it must be something that has changed in the DB. Trying to diff the DB dumps and see if I can find anything suspicious
-
@adrian Thank you for the input. I have been able to get the query like mentioned in the post above yours. This is quite some time back now. In the meantime I've come to love Tracy Debugger. It is very easy to setup and makes debugging fun. Wouldn't want to miss it now
-
SystemUpdater #12 Error, PW incompatible with mysql 5.7.x ?
gebeer replied to felic's topic in General Support
For hosting environments where you cannot change my.cnf and make settings persistent, you can do this: https://github.com/processwire/processwire-issues/issues/28#issuecomment-252870084 I just implemented it and it is working fine. -
[SOLVED] Field 'sort' doesn't have a default value
gebeer replied to gebeer's topic in General Support
Spot on, thank you. In my case it was ONLY_FULL_GROUP_BY that caused the problem This helped solving it: -
is pw 2.7.3 not compatible with mysql 5.7.12?
gebeer replied to adrianmak's topic in General Support
@LostKobrakai That did the trick. Site is back to normal now. Thanks a lot! -
SystemUpdater #12 Error, PW incompatible with mysql 5.7.x ?
gebeer replied to felic's topic in General Support
@felic Yes, it is possible on the console and through phpadmin. But the changes can only be made by a user with root privileges and they will not persist. So after a restart of mysql they will be lost. In most shared hosting environments we are not allowed to do these changes ourselves... -
is pw 2.7.3 not compatible with mysql 5.7.12?
gebeer replied to adrianmak's topic in General Support
@Robin S Thanks for the tip. In 3.x there is a setting $config->dbSqlModes = array( "5.7.0" => "remove:STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY" ); in https://github.com/processwire/processwire/blob/master/wire/config.php#L869 But it seems that 2.8 is not supporting those mode settings. At least I cant find anything related in https://github.com/processwire/processwire-legacy/blob/master/wire/core/WireDatabasePDO.php or https://github.com/processwire/processwire-legacy/blob/master/wire/config.php -
SystemUpdater #12 Error, PW incompatible with mysql 5.7.x ?
gebeer replied to felic's topic in General Support
@justb3a Did you change the settings in the my.cnf file or through phpmyadmin? I read that in order to make the changes persist across DB server restarts, we have to change my.cnf. What for shared hosting where we only have access through phpmyadmin? -
is pw 2.7.3 not compatible with mysql 5.7.12?
gebeer replied to adrianmak's topic in General Support
@adrianmak We're ecperiencing problems on a PW 2.7.0 install after MySQL upgrade to 5.7. Do you have any further findings, are PW 2.7 and MySQL 5.7 versions not compatible or did you get it to work? -
Hello, on a page that is live for over a year now, we get this error when trying to add a new child page to a certain parent: "Field 'sort' doesn't have a default value" EDIT: here's the whole error message: Couldn't find anything related on Google so I post here. The parent page has set sort for children by created date. No errors in eeror or exception log. When trying to save the new child page, the system also says that the name is already taken. But page under same parent with same name does not exist. Page is created in the background, though. When manually changing the name of the page (adding "-1" to the name), a new page is saved in the background but the system still says that the name is already taken. Now I'm clueless of what to do. Any help would be much appreciated.
-
@rastographics you're welcome. I didn't know much about docker either, before I put this together. Took me 2 days to get to know basic concepts and find existing images that I could base mine on. Read about docker-compose, too. But I decided to first learn proper use of docker with native docker utilities before using some wrapper around it. Makes me feel more confident when it comes to solving issues. Also, when you have setup your containers once with docker run ..., they are very easy to handle. Example: you have set up 3 containers following the README.md with names nginx, mariadb, example_com To stop them, just run: docker stop nginx mariadb example_com Next time you want to work on example_com: docker start nginx mariadb example_com Then you setup a fourth container with a new dev project with docker run --name example2_com ... To work on that project. you do: docker start nginx mariadb example2_com Its that easy. So I have no need for docker-compose. Just had a very quick look at wocker and it looks interesting. With my system I can start up a new project within less than 5 minutes. And thats quick enough for me
-
@microcipcip WireHttp is meant as a replacement for external PHP http client libraries like guzzle etc. You would want to use these when you 'talk' to the REST API that you set up with PW. Don't confuse this with clsource's Rest Helper class that I am using in my tutorial. You would still use that to build your REST API on the PW side. Today, If I wanted to develop a PW application that exposes JSON data through an API I would go with the brandnew GraphQL module by Nurguly. Seems like a much cleaner approach compared to REST.
-
PW based form centric website (Recommendations, please?)
gebeer replied to LimeWub's topic in General Support
As for organising your forms in the page tree, you could also save all form pages under one parent. When you save a form page via API, you can set the user who has created the form (which is the logged in $user). Some dummy code to achieve this $form = new Page; $form->template = 'form'; $form->parent = $pages->get('template=formparent'); /* set user who created this form */ $form->set("createdUser", $user); Then in the user's dashboard you get all the forms for that user with something like $forms = $pages->find("template=form, created_users_id={$user->id}"); I'm using this approach in some projects with frontend user dashboards and it works really well. Users can only see the content they created. All user content (here forms) lives under one parent page which makes it easy to create and query. Important note: in the backend you need to edit the form template and enable "Allow the 'created user' to be changed on pages?" under the "Advanced" tab. For the admin dashboard where forms for all users should be listed, you might want to spend a few bucks on Lister Pro. This saves you from developing a custom admin page. Lister Pro is very powerful and you can create a Lister that shows all pages with template form. You can list all forms sorted by created date, filter for forms of specific users etc. Also inline editing for the status field is possible. So admins can change the status very quickly. For the multi-step form: I also think that using Angular here would be overkill. I have a multi-step form that I render with PHP and use some very simple JS to step through the form. The form is divided into fieldgroups that reflect the steps. In the JS you can use AJAX to save the steps of the form that have been completed. Since you want to store the form data as JSON, you might want to look into a JS form framework that renders forms from JSON, something like Alpaca Forms. This would save you from creating the form rendering logic on the PHP side. They also support multi step form wizards. And, finally, what @adrian suggested above for creating users under different parents makes a lot of sense. I use this approach quite often. -
@microcipcip At the time of writing this tutorial and coding a real world application that uses this approach, I wasn't aware of the fact that PW brings it's own http client Class WireHttp. So today I wouldn't bother using an external library like guzzle or phphttpclient. I would go with WireHttp. It has all the methods you need. @clsource thanks for answering microcipcip's questions so thoroughly.
-
Update: Working with this setup I found that installing modules with the installer from the admin did not work because php-zip module was not installed. I fixed this and pushed the new image and Dockerfile to dockerhub and github.
-
@kreativmonkey you can leave out the namespace if the site works. You would need them if you were using other PHP libraries inside ProcessWire that might have naming conflicts. Otherwise you don't need them to make PW work. But in general it is a good practice to use namespaces if you are know what the implications are.
-
@arjen I updated the README at https://github.com/gebeer/alpine-php-processwire Hopefully this makes things more clear. And here is a great resource for some basic docker commands (listing/removing of images, containers and volumes). I needed them a lot when experimenting... Please let me know how it is going for you.
-
@kreativmonkey The thing is when you upgrade to 3.x and declare the namespace only in one file, it will most likely not work. You'd have to put the namespace line on top of all of your template files. Since the namespace is not declared in home.php but in function.php the file compiler in PW 3.x runs into errors. So either declare the namespace in all template files or in none. @all Please correct me if my assumption is wrong. At least this is how I understand it. When upgrading to 3.x it is a good idea to read up on PHP namespaces and search the forum for related threads. The error message in your first post points towards a syntax problem. But I can't spot an error in your syntax. Maybe someone else?
-
How do show pages on another page by a field?
gebeer replied to OpenBayou's topic in API & Templates
@kongondo Never mind. Need one anyways -
How do show pages on another page by a field?
gebeer replied to OpenBayou's topic in API & Templates
@kongondo Ok, I'm going and get a coffee EDIT: @OpenBayou Try this code <?php $deal_items = $pages->find("deals_show_on_endorse={$page->id}");?> <?php foreach($deal_items as $deal_item) : ?> <?php echo $deal_item->title;?> <?php endforeach; ?> -
How do show pages on another page by a field?
gebeer replied to OpenBayou's topic in API & Templates
Thats because of the s in <?php echo $deals_item->title;?> It needs to read <?php echo $deal_item->title;?> -
@kongondo guess you're right. I recently had problems upgrading to 3.x and found that putting the namespace in every file in my templates helped. But here it seems to be a syntax error. I couldn't spot it in the code provided so I wanted to make sure that it is not a compiling issue because of missing namespace.
-
Do you have <?php namespace ProcessWire; in the top of your _function.inc?
-
Hello everyone, I've been fiddling around a lot lately with docker containers for my local development on a linux machine. Tried many different options, also readily available processwire images and tutorials from the forum. But never got it right. Mainly because of permission issues with docker volumes. That is a tricky part on linux machines whereas on OSX it doesn't seem to be an issue. Then I discovered http://www.wordpressdocker.com/. And the setup with nginx as a proxy that routes requests to separate containers with the actual site install appealed to me. The whole thing sits on top of alpine linux containers which are really lightweight. So I decided to give it a try. And, first time since experimenting with docker, I got a running PW install. Rewriting was not working until I adjusted the nginx config. Now I have a fairly complex PW site running in a container. Everything is working, image upload/editing etc. So I'm really exited, especially since the dev site is now blazing fast compared to my old vagrant virtualbox vm setup. Honestly, I don't really understand everything that is happening behind the scene. But I managed to adjust the original files and build a new image that works with PW and doesn't have all the WP stuff. The nginx config I took from https://github.com/elasticweb/nginx-configs/blob/master/configs/processwire-2.conf Not sure if it covers everything for PW3 as well. I would very much appreciate if someone who is more in the know than me could take a look. All files for building the docker image are here https://github.com/gebeer/alpine-php-processwire A working image here: https://hub.docker.com/r/gebeer/alpine-php-processwire/ Documentation is kind of lacking. I took over quite a lot from the original project. But following the github README and the original documentation should get people started who have a little experience with docker already. If someone needs a more in depth step by step tutorial for setting things up, let me know and I'll put something together.
- 13 replies
-
- 10