Xonox
Members-
Posts
95 -
Joined
-
Last visited
Everything posted by Xonox
-
Hi, I'm building a newsletter via ProcessWire content. For this I'm bootstrapping ProcessWire via: include('index.php'); However, I'm getting this strange error: Fatal error: Uncaught exception 'WireException' with message 'Method Pageimages::size does not exist or is not callable in this context' in E:\WebServer\greentrekker.pt\wire\core\Wire.php:358 Stack trace: #0 E:\WebServer\greentrekker.pt\wire\core\WireArray.php(1686): Wire->___callUnknown('size', Array) #1 [internal function]: WireArray->___callUnknown('size', Array) #2 E:\WebServer\greentrekker.pt\wire\core\Wire.php(398): call_user_func_array(Array, Array) #3 E:\WebServer\greentrekker.pt\wire\core\Wire.php(333): Wire->runHooks('callUnknown', Array) #4 E:\WebServer\greentrekker.pt\wire\core\Wire.php(337): Wire->__call('callUnknown', Array) #5 E:\WebServer\greentrekker.pt\wire\core\Wire.php(337): Pageimages->callUnknown('size', Array) #6 E:\WebServer\greentrekker.pt\site\templates\parts\newsletter-template.php(69): Wire->__call('size', Array) #7 E:\WebServer\greentrekker.pt\site\templates\parts\newsletter-template.php(69): Pageimages->size(550, 260) #8 E:\WebServer\greentrekker.pt\site\templates\scripts\newsletter\newslette in E:\WebServer\greentrekker.pt\wire\core\Wire.php on line 358 Error: Uncaught exception 'WireException' with message 'Method Pageimages::size does not exist or is not callable in this context' in E:\WebServer\greentrekker.pt\wire\core\Wire.php:358 Stack trace: #0 E:\WebServer\greentrekker.pt\wire\core\WireArray.php(1686): Wire->___callUnknown('size', Array) #1 [internal function]: WireArray->___callUnknown('size', Array) #2 E:\WebServer\greentrekker.pt\wire\core\Wire.php(398): call_user_func_array(Array, Array) #3 E:\WebServer\greentrekker.pt\wire\core\Wire.php(333): Wire->runHooks('callUnknown', Array) #4 E:\WebServer\greentrekker.pt\wire\core\Wire.php(337): Wire->__call('callUnknown', Array) #5 E:\WebServer\greentrekker.pt\wire\core\Wire.php(337): Pageimages->callUnknown('size', Array) #6 E:\WebServer\greentrekker.pt\site\templates\parts\newsletter-template.php(69): Wire->__call('size', Array) #7 E:\WebServer\greentrekker.pt\site\templates\parts\newsletter-template.php(69): Pageimages->size(550, 260) #8 E:\WebServer\greentrekker.pt\site\templates\scripts\newsletter\newslette (line 358 of E:\WebServer\greentrekker.pt\wire\core\Wire.php) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. What am I missing here?
-
Sort problem: Selector with date needs empty dates last
Xonox replied to Xonox's topic in General Support
Hi LostKobrakai Looks interesting, thanks for pointing it out. For my current project is too much, I think, but I it will be useful in the future. -
Sort problem: Selector with date needs empty dates last
Xonox replied to Xonox's topic in General Support
Hi Soma, Your solution looks elegant. To me, it looks like the method you propose can be useful for more situations. Can you share link to a resource on how to do this? I looked for such a feature in the backoffice but couldn't find it so I figure it must be done via PHP, or am I wrong? -
Sort problem: Selector with date needs empty dates last
Xonox replied to Xonox's topic in General Support
I thought of that workaround but, as you stated, is quite ugly and, as you might know, the clients tend to not understand "why is that date there". A second find with an append might be another good solution. In terms of performance might be worth it because I'm showing a total of 6 items and if those six have dates, I don't need to get the one's that don't. I'll do some testing. Thanks SiNNuT! -
Sort problem: Selector with date needs empty dates last
Xonox replied to Xonox's topic in General Support
Hi Wanze, Most of the times ProcessWire has an elegant solution. I was hoping that someone would give me an insight about some hidden sort option that would allow me to avoid the array processing. However, your solution mentioned the $p->import($pages), that I was unaware of and it looks like it really fits my needs. Thanks a lot for your reply, I'll be using your code. -
Hi, I'm having a sorting problem that I need to solve. I have the following code: $today = time(); $trainings = $pages->get('/formacao/')->find("template=training, limit=6, !training_start<$today, sort=training_start"); It's working fine, except for one little problem: I need to show the trainings that have training_start filled first and then the one's that don't. This solution shows the empty ones first! Is there any way to do this with a simple selector? Or do I have to find twice? To understand better: Result that I have now: Footbal: Date not set yet! Ragueby: Date no set yet! Volleyball: 1-Apr-2016 Handball: 5-Apr-2016 Running: 10-Apr-2016 Jumping: 15-Apr-2016 Result needed: Volleyball: 1-Apr-2016 Handball: 5-Apr-2016 Running: 10-Apr-2016 Jumping: 15-Apr-2016 Footbal: Date not set yet! Ragueby: Date no set yet!
-
You're right. My test was not done well. I can't even insert an u with ~ through my keyboard because it doesn't exist in the portuguese language. I was inserting the page title field and watching the page name field for the result. You're absolutely right.
-
In portuguese there's o with ~ but not u. However, o with ~ is working fine, no need to add it. ... and in my tests, u with ~ is also working.
-
BEAUTIFUL!!!! Thanks guys! Each time I have a question I end up liking ProcessWire more and more! Everything can be reached just around the corner. I think that "ã = a" should be default. It's strange everything working BUT that one. By the way, it's: Admin > Modules > Core > InputfieldPageName Thanks again for the quick response.
-
Hi, The sites I develop using ProcessWire are, lots of times, in portuguese where we use accented characters. The problem is that when we add a page with a title like: Cães, Canhões e Fátima The page name I get is: c-es-canhoes-e-fatima When it should be: caes-canhoes-e-fatima As you can see, we're loosing the "a" with the respective SEO penalty. Usually, my clients can't be bothered to make the change manually, wich I think is fair on their part. As far as I can tell,"ã" is the only character that has that problem. Is this a bug? Is there anything I can do not to loose that "a" in the URL? Thanks!
-
Update: This eventually solved itself thanks to a solution for another related problem posted here: https://processwire.com/talk/topic/9818-how-can-i-add-an-href-security-exception/
-
After messing around config and php templates I finally got the script to work. Your idea of building a template to handle the ajax call was right on! I now have the script functioning inside its own folder with the ajax calls being handled by a page that has a special template that includes the script itself. Two big advantages: 1. No need to make changes to .href; 2. The problem that I was having with this script session was solved. I guess that calling a PW page means that the session is kept intact. Both problems were killing me for the past two days, I can now move on! Thanks Diogo, always nice to have some discussion about alternatives to solve problems. Greetings from Lisbon!!
-
Hi Diogo, Thanks for your input. It would be a great idea, but I'm afraid it won't work for what I intend to do. The file I mentioned (xcrud_ajax.php) is called by the script itself, not by me and I want to keep the script contained, so that I don't have to keep making changes whenever I update it. I tried to make your option work, I did some changes to the script configuration files to see if it would manage it, but to no avail. I really don't want to make changes to the script core. However I'll try to investigate a bit more that option because it might even solve a session problem I'm having with it. Thanks.
-
Hi, I really like PW's href security, however, I was having difficulties to post to an ajax call to a custom script because of it. After some trial and error, I came to the conclusion that the problem was here: # Block access to any PHP or markup files in /site/templates/ RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ [OR] So after commenting this line, all was working. However I would like to keep the security, adding an exception to the following file: site/templates/scripts/xcrud/xcrud_ajax.php Is it possible to add this exception to the .href file? How can I do that? Thank you.
-
Hi, I started this week to use ProcessWire, and I'm very glad with the product itself. It's a real CMS. However I'm facing a little trouble because of a script session, here's the situation: I'm developing a small backoffice using ProcessWire and a script called Xcrud, to access and modify a database. This script uses ajax and does a session verification on each post call. After some testing, I realized that the script gets an empty session after the ajax call. It looks like ProcessWire is destroying the session or something. So I'm not able to use Xcrud at all. I tried to name the session in PW and Xcrud to PHPSESSID to see if the session was kept but with no result. What am I missing? By the way, using the script without going through PW (barebones index.php) is working fine. So it's a PW session problem. Thanks for your help.