nbcommunication

Members
  • Content count

    19
  • Joined

  • Last visited

Community Reputation

10 Good

About nbcommunication

  • Rank
    Distinguished Member

Profile Information

  • Gender
    Not Telling
  • Location
    Lerwick, Shetland
  1. Update: I downloaded/installed a fresh copy of 3.0.62 and the same thing is happening, although only when using Inline mode. Regular mode works fine. I've submitted an issue on Github: https://github.com/processwire/processwire-issues/issues/279 Cheers, Chris
  2. Hi, Just had a client in touch to say that whenever they try to add an image into a content area (CKEditor Textarea) it always puts the image to the top. I've tested this on installs using various admin themes and the same thing is happening for me. Is anyone else getting this bug? Assuming it is likely to do with the update to CKEditor (which is lovely :D) Cheers, Chris
  3. Stack trace from the second example, which I called on the 404 page... Error: Exception: SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value (in ../wire/core/PagesEditor.php line 1388) #0 ../wire/core/PagesEditor.php(1388): PDOStatement->execute() #1 ../wire/core/Pages.php(882): ProcessWire\PagesEditor->sortRebuild(Object(ProcessWire\Page)) #2 ../wire/core/Wire.php(386): ProcessWire\Pages->___sort(Object(ProcessWire\Page), true) #3 ../wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___sort', Array) #4 ../wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'sort', Array) #5 /home/stmasway/public_html/site/templates/404.php(9): ProcessWire\Wire->__call('sort', Array) #6 ../wire/core/TemplateFile.php(268): require('/home/stmasway/...') #7 ../wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #8 ../wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #9 ../wire/core/Wire.
  4. Hi, I was adding a hook in admin.php which updates a field that is based on the sort value and runs after Pages::sorted. Looking through the docs, I figured hey I'll run $pages->sort($parent, true) so that the sort values are correct before setting the other field. Here's the basic hook: <?php namespace ProcessWire; $pages->addHookAfter("Pages::sorted", function($event) { $pages = $event->object; $page = $event->arguments(0); $pages->sort($page->parent, true); // Other stuff return; }); This kept returning the following exception: SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value (in .../wire/core/PagesEditor.php line 1388) Now, thinking through this, sorting the pages in the admin probably runs the sortRebuild() function that the error is referring to anyway, so $pages->sort($parent, true) isn't needed at all and perhaps this is why the error is appearing. However, I've just run <?php namespace ProcessWire; if($user->hasRole("superuser")) { $pages->sort($pages->get(1072), true); } And this is returning the same error/exception. The parent called above has 14 child pages. Running 3.0.62. Is this something I'm doing wrong? Cheers, Chris NB Communication
  5. Hi, I've been working a little bit with this new theme - it's great, and I'm looking forward to the full release. I've come across one issue so far. I'm aiming for CKEditor to use as many default UIKit styles/classes as possible, and so I updated ProcessPageEditImageSelect to use the UIkit Align classes (uk-align-right etc), but I can only get this to work if I disable the HTML Purifier. If enabled it strips the classes out. I've had a hunt to try and figure out how to add them as exceptions, but MarkupHTMLPurifier is called from the InputfieldCKEditor module, and there doesn't appear to be any way to add any exceptions in the InputfieldCKEditor module? I see that it checks ProcessPageEditLink for "AllowedFrameTargets" but not ProcessPageEditImageSelect for image classes? Cheers, Chris NB Communication
  6. Hi Robin, Aye, it certainly does, thanks!
  7. Hi, I'm sure this is maybe in the works already, given that findMany() is a recent addition to the API, but having this (and the other new find options) available to $users would be a great addition. Cheers, Chris NB Communication
  8. It appears as if renderReady ($this->config->scripts->add($url)) isn't actually firing before the scripts are rendered to the admin template. I've prepended the script manually in default.php and this has fixed the issue, although I'd rather the module did it! We use a custom admin template, but I did switch over to the default one to test it, and the result was the same. I also have had to implement valan's "clear:left;" CSS fix from above.
  9. Hello again, Fixed the previous issue by upgrading the module! However the map no longer displays - "google is not defined". It doesn't appear to be loading the maps api script. Anyone else come across this and have a solution? The site with the problem is running 2.5.3 Cheers, Chris
  10. Hi, We recently migrated to a new server and we're been getting the following error when saving a page with a MapMarker on it: Error saving field "marker" - SQLSTATE[01000]: Warning: 1265 Data truncated for column 'lat' at row 1 A little digging and I got this error when saving the field: Geocode is not supported because 'allow_url_fopen' is disabled in PHP Is it possible to get around this? Can this function be replaced with a CURL request? Cheers, Chris Thomson
  11. Hello, This was caused by a ModSecurity rule on the client's hosting environment - more info here: https://www.trustwave.com/Resources/SpiderLabs-Blog/ModSecurity-Advanced-Topic-of-the-Week--Remote-File-Inclusion-Attack-Detection/ Cheers, Chris
  12. Hello, One of our clients has an issue which I haven't seen before. When they go to edit a link in the body field (CKEditor inline mode), the modal box appears, but is populated with their website homepage. An example link from the modal's iframe is: /processwire/page/link/?id=1300&modal=1&href=http%3A%2F%2Fwww.charlottejamesedinburgh.com%2F When I go to this in a new browser window, it redirects to the homepage. It only seems to do this if "http://" is at the start of the link (which is should be). If I remove the http:// in the source - it opens fine. It is the same on all the pages I tested. They are on a shared hosting platform which we don't control, so I'm assuming this is probably responsible. If tried switching the two htaccess lines - RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] & RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA] - but this didn't have any effect. Any ideas what could be causing this redirect? There's nothing in the htaccess file which is different to how we have the large majority of our sites set up on our own hosting platform. Thanks in advance! Chris
  13. Hey there, I've devised another (DB query) solution that works better. Basically it searches a field table for duplicate values using this function: function dbQuery($table, $column) { $o = array(); $q1 = wire('db')->query(" SELECT `$column`, COUNT(`$column`) as c FROM `field_$table` GROUP BY `$column` HAVING c > 1 "); while ($r1 = $q1->fetch_array()) { $v = addSlashes(trim($r1[$column])); $o[$v] = array(); $q2 = wire('db')->query(" SELECT `pages_id` FROM `field_$table` WHERE `$column` = '$v' "); while ($r2 = $q2->fetch_array()) $o[$v][] = $r2['pages_id']; } return $o; } It then cycles through page ids, filtering out any pages that haven't been modified since a certain date (to do with the review period / 2 year lifespan of listing data), and also sorting them into two different arrays (residential listings and commercial listings). It then pops out the duplicates. I'm using this to filter by the following fields: title - dbQuery('title', 'data') tels - dbQuery('tels', 'value') - (table field) email - dbQuery('email', 'data') mobiles - dbQuery('mobiles', 'value') - (table field) It seems to be working well and it is a lot faster than what I had previously! Cheers, Chris
  14. Hi, There are a few 'duplication' measures in place. When a listing is submitted, the page name is logged if it finds a listing with the same name (which is a ->pageName() version of the title and address), and appends the datetime to the new listing when a listing is approved by the client admin, it archives any exact duplicates it finds (from a previous version of the directory already in place). The problem is that it needs to be able to identify potential duplicates at the time they are reviewing the listings... I'll look into the MySQL query stuff - thanks guys for your help so far! Cheers, Chris
  15. Hi adrian, Thanks for the reply - I'd hoped to be able to use count, but I need to return the ids of the duplicates too