-
Posts
11,204 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
How to configure CKEditor(textarea field) to enable Color toolbar?
adrian replied to KangLing's topic in Getting Started
Yes, or maybe this one: http://ckeditor.com/addon/colorbutton -
Not using SVGs on your site? You should be, and you should be sanitizing them: http://mods.pw/9U
-
Call to undefined method DirectoryIterator::getExtension()
adrian replied to Outcydaz's topic in General Support
PW requires 5.3.8 http://processwire.com/about/requirements/ -
Hey Joss - I think the issue is more about refreshing the modules cache in general which probably happens when you update another module. That error with PageEditFieldPermissionConfig is actually a bit painful - if you upgraded PW to latest dev before upgrading the module it becomes quite difficult to get rid of that error because you can't actually upgrade the module to the latest version that fixes it. You might need to manually uninstall it, then reinstall - at least that was my experience.
-
Until the core issue is fixed properly, simply wrap that entire function in: if (!function_exists('PageEditFieldPermissionConfig')) { That will get things working again for you.
-
Some threads worth reading if you haven't already seen them: https://processwire.com/talk/topic/5777-default-value-for-fields-in-admin/ https://processwire.com/talk/topic/1593-how-can-i-specify-default-value-for-certain-input-field/ https://processwire.com/talk/topic/394-default-field-value/
-
I have always read that DOMDocument was much quicker than regexes for parsing HTML, and it's certainly easier to build and read. Sounds like you know what you're doing though - sorry if I came across too strong - hard to know someone's experience level initially. Anyway, keep up the good work!
-
Hi rot - thanks for this. Might I make a small suggestion. You might find it simpler to use DomDocument - something like this: $p = $pages->get(1); $dom = new DOMDocument(); @$dom->loadHTML( mb_convert_encoding($p->body, 'HTML-ENTITIES', "UTF-8") ); $dom->preserveWhiteSpace = false; $images = $dom->getElementsByTagName('img'); foreach ($images as $image) { // the existing classes already on the images $existing_classes = $image->getAttribute('class'); // the class we're adding $new_class = ' this-will-be-the-class'; // the existing classes plus the new class $class_names_to_add = $existing_classes . $new_class; // add class to the parent of the img node - <a> $image->parentNode->setAttribute('class', $class_names_to_add); } In this example I am applying it to the body field of the homepage, but you get the idea
-
Hey kongondo, thanks for the suggestion - already on my list of things to do I would like to be able support Fieldset tabs as well as custom ones created via modules, like Nic's Page References Tab - I can see I am going to need more than one technique here Was there any particular custom tab setup you were interested in being able to hide? Just good to get an idea of all the possible options. Thanks!
-
Just wanted to follow up to say that today's PW core updates fix the issue with SVG files with no dimensions specified. There is also a new SVG validator/sanitizer that you should consider installing: http://modules.processwire.com/modules/file-validator-svg-sanitizer/ Please let me know if this solves all the issues with dimensionless / responsive (Illustrator's term, not mine) SVG images.
-
Looks like a path issue - includes need the full server path, but you have: Warning: include(/includes/webform.php): failed to open stream: You might be able to get away with ./includes/webform.php if includes is a subfolder of site/templates.
-
It looks like genre is a Page field? You need to get the titles for all the selected genres. You can do another foreach like: foreach($film->genre as $g) { echo $g->title; } or you can make use of WireArray::implode() https://processwire.com/talk/topic/5098-new-wirearray-api-additions-on-dev/
-
This module extends the FileValidatorModule to provide the ability to validate and sanitize SVG files. http://modules.processwire.com/modules/file-validator-svg-sanitizer/ https://github.com/adrianbj/FileValidatorSvgSanitizer If you're interested, here is some reading on why this is important: http://www.ei.rub.de/media/hgi/veroeffentlichungen/2011/10/19/svgSecurity-ccs11.pdf https://www.hackinparis.com/slides/hip2k11/09-TheForbiddenImage.pdf Have a read about about the new validator and the SVG sanitizer in Ryan's blog post.
-
I am not an SEO guru, but is the path to an image something that is actually considered? Have a quick read here: http://webmasters.stackexchange.com/questions/36434/what-should-filenames-and-urls-of-images-contain-for-seo-benefit You might find this module useful: http://modules.processwire.com/modules/process-custom-upload-names/ It allows you to automatically rename files/images as they are uploaded - you can make use all sorts of PW variables to define the scheme for the new name.
-
There are currently no known security issues in any version of PW, but I still like to update because of all the new toys (https://processwire.com/blog/) and bug fixes. Personally I like updating via git pull, but this module also makes it super easy: http://modules.processwire.com/modules/process-wire-upgrade/ Enjoy the ride
-
New link Attributes tab not working in TinyMCE
adrian replied to thetuningspoon's topic in General Support
Keep in mind that TinyMCE is no longer part of the PW core modules, so be sure to post here: https://github.com/ryancramerdesign/InputfieldTinyMCE -
The other tool to add to your belt is ModulesMigrator: https://processwire.com/talk/topic/8410-modules-migratorinstaller/ It will install, configure settings, and update to the latest versions all modules that you have selected. I have tagged it as alpha, but mostly because I haven't had any feedback on it. Maybe if this brings it back to life and I get some reports on it, I can get it released - it really is pretty straight-forward.
-
Hi @joineffort and welcome! Here's a great thread with some options: https://processwire.com/talk/topic/2868-count-views-of-post/ It's very easy! PS Marty beat me
-
Module Profile Export module (also upgrade PW 2.0 to 2.1)
adrian replied to ryan's topic in Modules/Plugins
That would be the reason then - I'll let Ryan know that the logic is going to need to be changed to handle these special DB tables. -
Module Profile Export module (also upgrade PW 2.0 to 2.1)
adrian replied to ryan's topic in Modules/Plugins
Any chance you have a custom database table that starts with "field_" but doesn't have a pages_id field/coumn? -
Thanks Martijn - not sure why I was using insertAfter there - just matching where it would be if it was visible, but since it's hidden it doesn't matter. I have committed a fix. Also just so everyone knows, I will get to all your suggestions for making this more configurable - just waiting on Ryan's thoughts on some of those issues regarding a core fix or not.
-
Not sure, but try this: Navigate to chrome://net-internals/#dns and press the "Clear host cache" button. Also try on another browser to confirm if it is an issue with your network or browser.
-
Thanks for debug report - I was able to reproduce the problem here and I have committed a fix. I hope I haven't broken anything else - it's a little complicated dealing with repeaters sometimes Please let me know if it works for you and if you find any other issues. BTW, I am assuming you have "Rename on Save" checked - that seemed to be when the issue showed up for me, although not always. I also improved the behavior for checking existing numbered suffixes on the same main page, so now you won't end up with two images of the same filename, one inside a repeater and one on the main page, which was possible before.
-
Thanks for all that info - I tried to replicate your image fields setup but still can't get the error. Sorry I didn't ask for quite the correct things for the log output. Can you please try replacing: //filename format can support $page, $template, $field, and $file variables in the format as defined in the module config settings //if repeater page, need to use parent page for determining name $page = $repeaterPage !== null ? $repeaterPage->getForpage() : $this->pages->get($pageid); $field = $this->fields->get($fieldid); $template = $page->template; $file = $this->pages->get($pageid)->$field->get("name={$path_parts['basename']}"); with: //filename format can support $page, $template, $field, and $file variables in the format as defined in the module config settings //if repeater page, need to use parent page for determining name error_log('pageid: ' . $pageid); $page = $repeaterPage !== null ? $repeaterPage->getForpage() : $this->pages->get($pageid); error_log('page->id: ' . $page->id); error_log('page->name: ' . $page->name); $field = $this->fields->get($fieldid); error_log('fieldid: ' . $fieldid); error_log('field->name: ' . $field->name); $template = $page->template; error_log('template->name: ' . $template->name); $file = $this->pages->get($pageid)->$field->get("name={$path_parts['basename']}"); and send me all the logged output. Hopefully that will help me figure out where the issue might be.