Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Arcturus

  1. Has anyone figured out how to get custom styles working with this module (short of changing the mystyles.js file in /wire/modules/Inputfield/InputfieldCKEditor)? After line 55 InputfieldMarkupCKEditor.module: $cke->attr('baseHref', '/'); // Works $cke->attr('contentsCss', '/site/modules/InputfieldCKEditor/ckeditor.css'); // Works $cke->attr('stylesSet', 'ckstyles:/site/modules/InputfieldCKEditor/ckeditor.js'); // Does nothing :(
  2. I ran into the following errors when switching from PHP version 7.3 to 7.4 with this module and ProcessWire 3.0.184 Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /home/build/public_html/site/modules/Recurme/MarkupRecurme.module on line 1082 (x2) Warning: Cannot modify header information - headers already sent by (output started at /home/build/public_html/site/modules/Recurme/MarkupRecurme.module:1082) in /home/build/public_html/wire/modules/Process/ProcessPageView.module on line 161 While this might be addressing the symptoms rather than the cause, I was able to restore full functionality by changing the first part of line 1082 from: private function i(){$this->v = false;} ... to private function i(){$this->v = true;} ... as suggested on a previous page, AND by also removing all of my license information (email and key) within the admin settings. There may be a more proper fix to the issue, but I wasn't willing to deconstruct that line's 1,691 characters of complexity to seek it out.
  3. Has anyone been able to install any of the 2.x versions of Version Control with PW 3.0.165? I keep running into the following error:
  4. Thanks Ghostrider! Your changes fixed our issues, without seeming to conflict with our own customizations.
  5. Speaking of strange behaviours... despite not having changed a single thing with our Recurme installation since early January, it's now returning EXCLUDED DATES with both $recurme->find and $recurme->renderCalendar for any month that's shorter than 31 days. I have no idea why. The Recurme debug report shows no anomalies between months. This issue would have been very noticed for us had it been present in February, and the events that are broken now are the ones we used to build and validate the system. Check your sites. It may have triggered following the leap year date and was difficult to notice since March was not affected. My event pages (luckily) bypass the Recurme module to work directly with the page-related JSON-entry in the database, so no issues there. Others may not be so lucky.
  6. During a recent maintenance routine we found that our website's database (1,700+ pages) had thousands of instances of unnecessary, garbage code that had come with copied text from Word. Passages with margins expressed in points, cms and inches, and some that were wrapped in upwards of 7 spans were among the most easily identified crimes. Purging all of this dropped our database size by over 4%. A few of the code examples above nuke all inline styles, which will impact some important out-of-the-box functionality for PW3 and CkEditor (depending on your use); specifically with many of the options with tables and lists, such as setting a column width or changing the bullet styles within a nested list. To work around that, I made some changes to Ryan's code to target specific tags and to eliminate spans (which you can only add via Source view without pasting them in). $wire->addHookAfter('InputfieldCKEditor::processInput', function($event) { $inputfield = $event->object; $value = $inputfield->attr('value'); if ((strpos($value, 'style=') === false) && (strpos($value, '<span>') === false)) return; $count = 0; $qty = 0; // Optional remove spans $value = preg_replace('/<span.*?>/i', '', $value, -1, $qty); $value = preg_replace('/<\/span.*?>/i', '', $value, -1); $count = $count + $qty; // Remove inline styles from specified tags $tags = array('p','h2','h3','h4','li'); foreach ($tags as $tag){ $value = preg_replace('/(<'.$tag.'[^>]*) style=("[^"]+"|\'[^\']+\')([^>]*>)/i', '$1$3', $value, -1, $qty); $count = $count + $qty; } if(!$count) return; $inputfield->attr('value', $value); $inputfield->trackChange('value'); $inputfield->warning("Stripped $count style attribute(s) from field $inputfield->name"); });
  7. If you've customized the CSS for the content within your regular CKEditor fields, you can bring that styling over to this module by adding the following to InputfieldMarkupCKEditor.module around line 51. $f->attr('baseHref', '/'); $f->attr('contentsCss', '/site/modules/InputfieldCKEditor/ckeditor.css');
  8. We purchased the module in August and have run into some issues now that we've had a chance to implement it. Code > $event = $recurme->event($page); Result > Notice: Undefined property: stdClass::$timeEndUnix in .../site/modules/Recurme/MarkupRecurme.module on line 856 Robin raised this issue earlier in this thread and, if a solution was found, it wasn't shared or implemented in the downloads. Update 12/13/2019 Replacing $timeEndUnix = $data->timeEndUnix; With if(isset($data->timeEndUnix)){ $timeEndUnix = $data->timeEndUnix; } else { $timeEndUnix = false; } Removes the error, but I suspect that I was trying to use the method in the wrong way/context given a misunderstanding of the documentation. I'm having to use the JSON decode method (example: $times = json_decode($page->event_times)), with a lot of template-level processing, to populate my event detail pages. Is that the best way? [/End Update] itsberni and others have asked about handling time variance for a recurring event, which strikes me as a rather essential feature. Has anyone found a solution or workaround for this? I suspect that adding a second recurme field to an event page will lead to a lot of pain elsewhere (but I could be wrong), and cloning an event's page to support another time would require me to implement measures to connect the clones (doable, but sloppy from both an admin and user standpoint). A couple of items which may help others: The "Repeat Never" switch does nothing for me out of the box (other than hiding the rest of the options) as every single-day event I entered was automatically being assigned a default value of End Never and repeating 2,800 days. I had to hack both the rrule-gui.js and InputfieldRecurme.module files to default to After 1 Time(s) to rectify this issue. Commenting out -- results.find('.inner').scrollTop(0); -- in rrule-gui.js, around line 1153, will save a lot frustration for anyone needing to exclude multiple dates from a results table.
  9. Thankfully I was able to resolve my own issues here. I'm not sure what went wrong with my initial setup on the development server, but I purged the /site/ side and database, and re-started the migration and CKEditor no longer logs me out of the site. With that resolved, I was quickly able to exonerate Jumplinks and Page Protector of any blame for the http links issue. After some more investigating, I began testing parts of my .htaccess file and quickly found the source of the matter. ... RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http%3A%2F%2F [OR] ... RewriteRule ^(.*)$ - [F,L] The condition comes from a set of rules used to block MySQL injections and other forms of query-based attack, and it was unfortunately interfering with how ProcessWire transitions from the CKEditor to its link editing modules. Simply commenting that line out (with a # at the start) fixed the issue on both servers.
  10. On our production site (v3.0.123): We're just about to launch a new website and have had the bizarre issue develop in the past week where editing any existing http-based link (either via the right-click or toolbar within a CKEditor field) is loading a 404 error page within the link editing modal. Meanwhile, editing an https, tel, or mailto protocol link loads the editor without issue. Isolating the 404 frame within the modal shows the URL below. If I manually add an 's' to that address, the editor loads. https://[domain]/edit/page/link/?id=2481&modal=1&href=http%3A%2F%2Fwww.crhc.ca%2F&class=ctalink - 404 https://[domain]/edit/page/link/?id=2481&modal=1&href=https%3A%2F%2Fwww.crhc.ca%2F&class=ctalink - Loads Other than the 404 screen, there's no other error message appearing within the admin or the browser console. The only recent changes we made to the site's configuration were the additions of the Jumplinks and Page Protector modules, although I believe the issue was present prior to their installation. Because I need both of those modules for a fast approaching launch day, I've created a complete 100% copy of the site to explore rolling things back. However,... On our development site (v3.0.123 - same server, same environment settings, separate user account): For whatever reason, accessing any admin page with a CKEditor field on this site immediately logs the user out of ProcessWire. You can view the editor page, and all the content loads (although I can't open repeaters), but any action returns the login screen. Everything else on the backend and frontend of the copy is working as expected. Again, there's no other error message appearing within the admin or the browser console. Any idea on what may be causing either issue, or what I could do to better diagnose them? Debug is set to true on both sites and it's not a browser issue (tested Chrome, Firefox and Opera).
  11. If anyone was wondering, this module seems to work fine with the CroppableImage3 fieldtype.
  12. This may help others. You're going to get labels for this field's output that you probably won't need (no fault of this module). This CSS .InputfieldMarkupCKEditor .InputfieldHeader { display: none; } will hide them visually, while this JavaScript function (function () { var labels = document.querySelectorAll('.InputfieldMarkupCKEditor .InputfieldHeader'); for (var i=0; i < labels.length; i++) { labels[i].setAttribute('aria-hidden', 'true'); } })(); will hide them from screen readers.
  13. Thanks for this module, Robin. Note that the download link on the module page is broken.
  14. Thanks for getting back to me. I'm not using AOS, but I can understand why you wouldn't want to maintain a separate project. No problem though, it only took me a few minutes to apply both of my desired changes to your existing plugin. For anyone else who's interested, here are the altered lines (91-96) from plugin.js } else if(use_description && $(this).attr('title').length) { text = $(this).text(); } else { text = $(this).attr('title'); } html = '<a href="' + $(this).data('url') + '" target="_blank">' + text + '</a>' Those 60+ users are coming over to PW from ExpressionEngine, so this will be an entirely new process to them anyway. But much easier for me to teach them now.
  15. I had the same concern as cjx2240. Not the most elegant approach, but since I'm not a JavaScript wizard I directly edited the following files and placed a note in my root development directory to tweak these when updating the CMS. wire\modules\Inputfield\InputfieldCKEditor\ckeditor-4.8.0\plugins\table\dialogs\table.js wire\modules\Inputfield\InputfieldCKEditor\ckeditor-4.8.0\plugins\table\dialogs\table.min.js Tip: Where it says "100%":500:0 change it to "100%":"100%":0 If anyone knows how to achieve this 'non-destructively' from a user's config.js, it would be great to know.
  16. This is great Robin! Is there any way to make the description (if available) the default text for the link rather than the filename? I can handle the alt+ trick, but won't be able to teach that to 60+ users. It would be great if it were an option, same with setting a default target for the generated links (we always have files open in a new tab).
  17. I had the exact same problem as gmclelland with creating a new repeater in PW 3.0.62 for a site that had migrated from 2.x. Unfortunately, temporarily purging all of my existing repeater fields and data from the database so that I could uninstall/reinstall the Repeater fieldtype did not resolve my issue. However, here's what worked for me: Create your repeater field using the normal method and save it to trigger the "You must assign a template to the page..." error. Note the ID number for your new field (mine was 170) Manually create a parent page for the repeater within the page tree (Admin > Repeaters > new) using the Admin template and the URL of for-field-170 (with the 170 being the ID from step 2) and publish it. Note the ID number for your new repeater parent page (mine was 1949) Using phpMyAdmin or equivalent, navigate to your Fields table and find the row for your new field (it's sorted by the same ID, so I looked for 170) and insert "parent_id":1949, (actual ID from step 4) directly after the template referenced in the Data column. When I returned to the admin page for my field after this, the error message was gone, the details tab was present, and I could successfully add fields to my repeater.
  18. No worries Adrian, I'll see if I can circle back to that project and investigate next week.
  19. Just wanted to add another report of non-well formed numeric values occurring with PHP 7 (specifically 7.1.7). Pmichaelis' solution works, but only allowed the caching of a single CSS and JS file for my entire site, while Adrian's (several posts above) works and allows for several of each. That said, AIOM still breaks when a template calls for a file that hasn't been previously generated with either of those solutions and remains so even on a reload when a cached file should be available. To get that original page working, I need to jump to a different page using that template (which renders correctly) and then back to the original page. Edit: ...and by break, I mean it adds a string error message (with some HTML) to the SRC path for each item in your array, so the browser tries to load the CSS or JS file at a URL consisting of multiple error messages followed by the correct path in one epically long string.
  20. I'm having an issue in PW 3.0.62 where the module will only geocode an address when I manually click the checkmark between address and lat/lng off/on when editing the page within the admin. Based on what I've read here, it seems only the client-side geocoder is working? Additional details: I have both Google Maps and Google Places APIs working without issue on the front-end and have added my Maps key to the module's configuration My MapMarker-based field, "map", has a MapMarker: Error geocoding address notification and I can't find any elaboration Neither API has any issues with my address formatting/default address, with an example being 5 Bloor Street, Toronto, ON M4W 3T3 My addresses are mapping properly when I play with the checkbox (status goes from UNKNOWN to OK) I can't trigger the geocoding via the API Any ideas?
  21. Thanks, Robin! I have a slight variant for offline users and am curious as to why an OR operator doesn't seem to work there. // Offline users $offline_users = $pages->find([ 'id!=' => $online_user_ids, 'template' => 'user', 'name!=' => 'guest', // this is fine for my specific use case 'roles=' => 'agent' // returns expected listing // 'roles=' => 'agent|superuser' returns nothing when used ]); I can get around this by assigning the agent role to each superuser (changes nothing really), but I'm not sure that what I was attempting was technically wrong.
  22. I have a nearly identical use scenario where isLoggedin is always returning true, except I'm running PW 3.0.61 and am looking to return two lists. Here's the code: $members = $users->find("roles=superuser||agent"); $active = new PageArray(); $inactive = new PageArray(); foreach ($members as $account){ if ($account->isLoggedin()) { $active->add($account); } else { $inactive->add($account); } } After dozens of searches I found this thread and enabled the Session Handler Database module as suggested, but that had no effect on every user showing up as logged in on my local machine. From what I can tell, that only seems to add a page to the back-end (where I don't need it). Any ideas?
  23. Hi Adrian, I'm having some issues getting the proper output formatting with PW 3.0.61 and the following custom format option: {[phoneAreaCode]-}{[phoneNumber,0,3]-}{[phoneNumber,4,4]} /* Local North America: 111-111-1111 */ The dropdown outputs my example numbers correctly (555-555-5555), both the module and my phone-based field show the correct format chosen, and on the data entry side, I'm getting Area Code and Number fields in the same box which makes sense. However, when I go to output this field on the front end... /* imagine the entered data is 416 7773333 and the desired output is 416-777-3333 */ echo $user->cell_phone; /* returns 7773333 */ echo $user->cell_phone->formattedNumber; /* returns nothing, as does the 'un' variant */ echo $user->cell_phone->area_code.$user->cell_phone->number; /* returns 4167773333 */ I could string manipulate the last into what I need, but that would seem to defeat the purpose of the module. Is this only intended to work with $page based references?
  • Create New...