Jump to content

KarlvonKarton

Members
  • Content Count

    87
  • Joined

  • Last visited

Community Reputation

39 Excellent

About KarlvonKarton

  • Rank
    Full Member

Contact Methods

  • Website URL
    www.karlvonkarton.be

Profile Information

  • Location
    Belgium
  • Interests
    Surf - Windsurf - Belgian - Music Producer - Ginger - Creative - Code

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I had to create a similar selector today, so I share as an example: $paramdate = strtotime('2018-01-01'); $numPanden = $pages->find("template=panddetail,(ska_Status=FOR_SALE),(ska_Status=SOLD,ska_PropertyModified>$paramdate),ska_Project=0"); Why are you having round brackets around every field? My guess is that you only need brackets around the template field?
  2. The new website is OK, but the docs are unreadable for me. The contrast of the black code background with the white pages make my eyes hurt like crazy... Fix that please!
  3. I think you're right. I still wonder why the SQL is altered (RF or OS or combi OS/SQL), but I also understand now that I simply made the mistake by using uppercase for fields either way. Good to know for future projects...
  4. It should, but it doesn't change the outcome. (I've tried both upper or lowercase) Whatever I try (upper, lowercase), the SQL statement created by RockFinder is changing the name of the table to 'field_ska_City' while the name of the table is 'field_ska_city'... (in the last FROM - see SQL above)
  5. I have tried to execute the SQL with phpmyadmin on both servers (live and dev). On DEV it works, but not on LIVE. The problem is that RockFinder switches from uppercase to lowercase in the SQL. Just check this SQL: SELECT `rockfinder`.* FROM /* original pw query */ (SELECT pages.id FROM `pages` JOIN field_ska_status AS field_ska_status ON field_ska_status.pages_id=pages.id AND (((field_ska_status.data='FOR_SALE' ) )) LEFT JOIN field_ska_city AS field_ska_city__blank3 ON field_ska_city__blank3.pages_id=pages.id LEFT JOIN field_ska_city AS _sort_ska_City ON _sort_ska_City.pages_id=pages.id WHERE (pages.templates_id=49) AND (pages.status<1024) AND (((field_ska_city__blank3.pages_id IS NOT NULL AND (field_ska_city__blank3.data!='' OR field_ska_city__blank3.data='0')))) GROUP BY pages.id ORDER BY _sort_ska_City.data ) as `pwfinder` /* rockfinder */ LEFT JOIN ( SELECT `pages`.`id` AS `id`, `ska_City`.`ska_City` AS `ska_City` FROM `pages` /* --- join ska_City --- */ LEFT JOIN (SELECT `pages_id` AS `pageid`, `ska_City`.`data` AS `ska_City` FROM `field_ska_City` AS `ska_City`) AS `ska_City` ON `ska_City`.`pageid` = `pages`.`id` /* --- end ska_City --- */ ) AS `rockfinder` ON `pwfinder`.`id` = `rockfinder`.`id` /* end rockfinder */ In the JOIN the field is field_ska_city, but in the last FROM the field is field_ska_City... Is that normal behavior? Is this a bug? The code I use: $finder = new \ProcessWire\RockFinder("template=panddetail,ska_Status='FOR_SALE',ska_City!='',sort=ska_City",['ska_City']); $sql = $finder->getSQL(); print_r($sql); $finder->sql = "SELECT ska_city AS city FROM ($sql) AS tmp GROUP BY city"; $ska_Cities = $finder->getValues('city'); print_r($ska_Cities);
  6. Serverversie: 5.6.41-log - MySQL Community Server (GPL) = LIVE Serverversie: 5.6.38 - MySQL Community Server (GPL) = DEVELOPMENT
  7. I've compared the $sql variables on the live server end the local server. They both are the same. SELECT `rockfinder`.* FROM /* original pw query */ (SELECT pages.id FROM `pages` JOIN field_ska_status AS field_ska_status ON field_ska_status.pages_id=pages.id AND (((field_ska_status.data='FOR_SALE' ) )) LEFT JOIN field_ska_city AS field_ska_city__blank3 ON field_ska_city__blank3.pages_id=pages.id LEFT JOIN field_ska_city AS _sort_ska_City ON _sort_ska_City.pages_id=pages.id WHERE (pages.templates_id=49) AND (pages.status<2048) AND (((field_ska_city__blank3.pages_id IS NOT NULL AND (field_ska_city__blank3.data!='' OR field_ska_city__blank3.data='0')))) GROUP BY pages.id ORDER BY _sort_ska_City.data ) as `pwfinder` /* rockfinder */ LEFT JOIN ( SELECT `pages`.`id` AS `id`, `ska_City`.`ska_City` AS `ska_City` FROM `pages` /* --- join ska_City --- */ LEFT JOIN (SELECT `pages_id` AS `pageid`, `ska_City`.`data` AS `ska_City` FROM `field_ska_City` AS `ska_City`) AS `ska_City` ON `ska_City`.`pageid` = `pages`.`id` /* --- end ska_City --- */ ) AS `rockfinder` ON `pwfinder`.`id` = `rockfinder`.`id` /* end rockfinder */ SELECT `rockfinder`.* FROM /* original pw query */ (SELECT pages.id FROM `pages` JOIN field_ska_status AS field_ska_status ON field_ska_status.pages_id=pages.id AND (((field_ska_status.data='FOR_SALE' ) )) LEFT JOIN field_ska_city AS field_ska_city__blank3 ON field_ska_city__blank3.pages_id=pages.id LEFT JOIN field_ska_city AS _sort_ska_City ON _sort_ska_City.pages_id=pages.id WHERE (pages.templates_id=49) AND (pages.status<2048) AND (((field_ska_city__blank3.pages_id IS NOT NULL AND (field_ska_city__blank3.data!='' OR field_ska_city__blank3.data='0')))) GROUP BY pages.id ORDER BY _sort_ska_City.data ) as `pwfinder` /* rockfinder */ LEFT JOIN ( SELECT `pages`.`id` AS `id`, `ska_City`.`ska_City` AS `ska_City` FROM `pages` /* --- join ska_City --- */ LEFT JOIN (SELECT `pages_id` AS `pageid`, `ska_City`.`data` AS `ska_City` FROM `field_ska_City` AS `ska_City`) AS `ska_City` ON `ska_City`.`pageid` = `pages`.`id` /* --- end ska_City --- */ ) AS `rockfinder` ON `pwfinder`.`id` = `rockfinder`.`id` /* end rockfinder */ But $ska_Cities array remains empty on live server. Yet a copy of site on development server $ska_Cities is print_r: Array ( [0] => Array ( [city] => Aalst ) [1] => Array ( [city] => Duinbergen ) [2] => Array ( [city] => Heist-aan-Zee ) [3] => Array ( [city] => Knokke-Heist ) [4] => Array ( [city] => Oostende ) [5] => Array ( [city] => Varsenare ) [6] => Array ( [city] => Wenduine ) [7] => Array ( [city] => Zeebrugge ) [8] => Array ( [city] => Zwevegem ) ) ps: NO errors
  8. I have a problem getting to use Rockfinder online correctly. On my developer network every works fine, but once the site is online, RockFinder stops working. $finder = new \ProcessWire\RockFinder("template=panddetail,ska_Status='FOR_SALE',limit=0,ska_City!='',sort=ska_City",['ska_City', 'ska_ZipCode']); $sql = $finder->getSQL(); $finder->sql = "SELECT ska_City AS city, ska_ZipCode AS zip FROM ($sql) AS tmp GROUP BY city"; $ska_Cities = $finder->getArrays(); print_r($ska_Cities); I don't understand why... I also used new Rockfinder (without namespaces etc) I checked PHP version too... Is there some specific dependency that Apache or PHP should have for RockFinder?
  9. Great module! It is everything I needed for "group by" queries.
  10. Given the client situation I think it's best to inform them to be careful with the categories (for now)... And maybe later I will go for the hook option (it would be my first hook actually - no more escapism ). IMHO: I think that this should be some core logic not to be able to delete pages that are referenced by other pages via the PageField. Or at least get a notice that there are still references to it. It feels odd to me like this.
  11. Maybe I should have specified that, but I mean in admin (not api). Now I can just click on trash on a category and even when still referenced it is trashed immediately. (I don't want that )
  12. Hi, I'm having projects pages and categories pages. Each project has a PageField that references to one or more category/ies. How can I prevent that a category is deleted/trashed when a project still references it? Thx.
  13. Hello Forum, Yet another question. I'm importing data from an old database structure into Processwire. But when I import following data into a textarea (the standard Body one) then I get a lot of <p>&nbsp;</p> for some odd reason. Someone has a clue? I have used several approaches. // this $text = nl2br($r['textEN']); // but also this $text = $sanitizer->textarea($r['textEN'],array('multiLine'=>false,'newlineReplacement'=>'<br>','stripTags'=>false)); // // no difference The data from a text field in mysql: <table border="1" cellspacing="0" cellpadding="0"> <tbody><tr> <td width="403"><p><strong><em>Results</em></strong></p></td> <td width="95"><p align="right"><strong>30.06.2017</strong></p></td> <td width="96"><p align="right"><strong>30.06.2016</strong></p></td> </tr> <tr> <td><p>Operating result</p></td> <td><p align="right">11,402</p></td> <td width="96"><p align="right">10,163</p></td> </tr> <tr> <td><p>Net result of the year</p></td> <td><p align="right">3,853</p></td> <td width="96"><p align="right">2,688</p></td> </tr> <tr> <td><p>Share of the group in the net result of the year</p></td> <td><p align="right">3,888</p></td> <td width="96"><p align="right">2,689</p></td> </tr> <tr> <td><p><strong><em>Balance sheet</em></strong></p></td> <td><p align="right"><strong>30.06.2017</strong></p></td> <td width="96"><p align="right"><strong>31.12.2016</strong></p></td> </tr> <tr> <td><p>Total assets</p></td> <td><p align="right">641,120</p></td> <td width="96"><p align="right">605,547</p></td> </tr> <tr> <td><p>Cash and cash equivalents</p></td> <td><p align="right">17,263</p></td> <td width="96"><p align="right">15,273</p></td> </tr> <tr> <td><p>Net financial debt (-)</p></td> <td><p align="right">360,423</p></td> <td width="96"><p align="right">341,263</p></td> </tr> <tr> <td><p>Total equity</p></td> <td><p align="right">214,257</p></td> <td width="96"><p align="right">210,408</p></td> </tr> </tbody></table> The result in the textarea Body (source view): <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <table border="1" cellpadding="0" cellspacing="0"> <tbody> <tr> <td> <p><strong><em>Results</em></strong></p> </td> <td> <p><strong>30.06.2017</strong></p> </td> <td> <p><strong>30.06.2016</strong></p> </td> </tr> <tr> <td> <p>Operating result</p> </td> <td> <p>11,402</p> </td> <td> <p>10,163</p> </td> </tr> <tr> <td> <p>Net result of the year</p> </td> <td> <p>3,853</p> </td> <td> <p>2,688</p> </td> </tr> <tr> <td> <p>Share of the group in the net result of the year</p> </td> <td> <p>3,888</p> </td> <td> <p>2,689</p> </td> </tr> <tr> <td> <p><strong><em>Balance sheet</em></strong></p> </td> <td> <p><strong>30.06.2017</strong></p> </td> <td> <p><strong>31.12.2016</strong></p> </td> </tr> <tr> <td> <p>Total assets</p> </td> <td> <p>641,120</p> </td> <td> <p>605,547</p> </td> </tr> <tr> <td> <p>Cash and cash equivalents</p> </td> <td> <p>17,263</p> </td> <td> <p>15,273</p> </td> </tr> <tr> <td> <p>Net financial debt (-)</p> </td> <td> <p>360,423</p> </td> <td> <p>341,263</p> </td> </tr> <tr> <td> <p>Total equity</p> </td> <td> <p>214,257</p> </td> <td> <p>210,408</p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> PS: sorry for the long markup/post...
×
×
  • Create New...