-
Posts
295 -
Joined
-
Last visited
Everything posted by Orkun
-
Change Language Inherit for empty multi-lang fields
Orkun replied to Orkun's topic in Multi-Language Support
Hi @BitPoet Could you possibly explain that further? I have to confess, that I don't really understand the whole Multilang Structure/Process of Processwire. What I have so far is only this: // Written inside an autoload module called sitehelper $this->addHookAfter('LanguagesPageFieldValue::getStringValue', $this, 'hookLangInherit'); public function hookLangInherit(HookEvent $event){ } I tried to split the process in two points: 1. The Hook should only be executed on multilang fields of the template "doctors". 2. It should replace the default lang with the new language which you have chosen in "absender" pages as new inheritvalue. - (Absender Pages are linked to doctor pages via pagefield - multi selection - It should take the languagevalue/inheritvalue always from the first absender which is linked to the doctor) Does $event->object->getLanguageValue($language) return the current page the hook is executed or what? I apologize @BitPoet if I am pushy but I just want to understand the cause and learn from it, since I don't know all rough edges of ProcessWire. Would be glad If you could spend some of your time. Greetings Orkun -
Change Language Inherit for empty multi-lang fields
Orkun replied to Orkun's topic in Multi-Language Support
I really need this. No one an Idea? -
Is it possible to write a hook where I could change the language inherit for empty multi lang fields not to take the default? Like for example: All Doctors(with template doctors) are taking the italian(or some other language) field value when the german(is not defined as default language) field value is empty. Otherwise it should take the german field value. Perhaps a pagefield(single select) with all languages where I can choose the new "pseudo default inherit". Would this be possible or. do you have a idea how to accomplish this? Greetings Orkun
-
Would it be possible to integrate this config saving feature also in the Media Manager? It would be a very nice addition to it and it would very speed up the workflow of the users.
-
Thanks! @BitPoet I removed now ONLY_FULL_GROUP_BY and STRICT_TRANS_TABLES from the sql_mode and it works know with 4 characters :). Now I am trying to change the full text index minimum word length. I found a site which describes this easy and clean: https://www.electrictoolbox.com/mysql-full-text-index-word-length/. Now I tried this on localhost where I changed the ft_min_word_len to 3. It worked in the lister pro at first, but it doesn't affected the media manager search. So I made "REPAIR TABLE field_media_manager_image QUICK; and it also started working. Do I have to do this repair only for the media manager fields(tables)? Are all other Fields/Tables(created by the GUI) automatically updated since the lister pro worked straight after I changed the ft_min_word_len? Greetings Orkun EDIT: I have let my hoster to change the ft_min_word_len to 3. Now filtering for tags works great in the media manager/listerpro. I also had to reindex the tables of the media manager to get it finally working. Made it with REPAIR TABLE tablename QUICK;
-
Hi guys I have a problem with a specific filter/selector I try to achieve. The following filter causes a SQL-Error. This error also appears when I want to sort subfields(options and page fields - multi and single select) in the lister or with the API. Some Infos Processwire Version: 2.7.3 ListerPro Version: 1.0.8 Media Manager: 0.0.6 PHP-Version: 7.0.8-0 UBUNTU 0.16.04.3 MySQL-Version: 5.7.13-0ubuntu0.16.04.2-log - (Ubuntu) I tried changing the sql_mode many times: DEFAULT IS: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_ENGINE_SUBSTITUTION I tried all above but with minimal effect. When I remove "ONLY_FULL_GROUP_BY" it doesn't cause a SQL-Error but it still can't find the page. Also sorting subfields start working. But everything works fine locally on a fresh blank install with the media manager and listerpro. My local MySQL Version is 5.6.25 and PHP version is 5.6. ----------------------------------------------------------- The Intention why I am asking (last post): ----------------------------------------------------------- Some other Processwire Topics related to sql_modes: I wanted to ask in the forum before I try it on github: https://github.com/processwire/processwire-issues ----------------------------------------------------------- Some related links to sql_modes: http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_sql_mode http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html Greetings Orkun
-
I tried the Lister Pro 1.0.8 with Media Manager 0.0.6 on localhost on a fresh install. It works well with the "contains words" option. Looks like it's a issue from some code snippets(hooks etc..) I wrote. I will search through the code to look if I find something which causes this problem. Sorry for blowing up the thread @kongondo...
-
Hi @kongondo I have a couple of Questions: 1. Is it possible to save the filter interface configuration (like in ListerPro)? 2. Filtering tags by words (it should ignore the order) doesn't work as expected. I have this image with the following tags: Eintritt Formular Event But when I try to filter with "Contains Words" it doesnt't work as expected, it doesn't find anything. So I tried it also to search with the listerpro and there I get this error: Do you have any ideas why this doesn't work?
-
Somehow the InputfieldPageName settings doesn't have any effect on the filename of images (i changed "ö=o" to "ö=owww" to test and it only affected the pagename when creating new pages). Perhaps I should start a new topic since this isn't a Media Manager issue furthermore it is a pw-general issue (I know it isn't really an issue since its just validating the filename, but it still adds underscores when using umlauts, which i think is a issue, since it is nowhere declared how i can change this behavior) . Sorry for hijacking this thread Mate. But still thanks for your help @kongondo.
-
@kongondo @adrian When I change the code from the WireUpload::validateFilename method like this, it doesn't add any underscores more: //$value = $this->wire('sanitizer')->filename($value, Sanitizer::translate); $value = $this->wire('sanitizer')->filename($value); // removing Sanitizer::translate But I don't know how big this affects other code areas of ProcessWire. Do you know an other way how i could turn off adding of underscores to the filename?
-
Hi @kongondo I have a question about uploading images/files with umlauts in the filename. When I upload a image like this for example: It converts the filename to this: Is it possible to change this, that it takes the filename as it is? I'm also confused why it adds underscores since the filename doesn't have empty spaces? My Customer needs this, because he has many photos with french/german filenames (which has umlauts). Greetings Orkun
-
Hi @kongondo Does this functionality scan all Image and File Fields for new media and create new media-manager-image/file pages? I think it scans the assets/files folders? I have a couple of image and file fields with media in it but the scan functionality can't find any media. Or do I missunderstand the use of this scan functionality? Greetings Nukro
-
The only issue left is, when I click "save as copy" without cropping or changing the dimensions. It somehows loses the original:
-
Ok i solved the video problem with setting the maximum allowed size of uploaded files. ; Maximum allowed size for uploaded files. upload_max_filesize = 100M ; Must be greater than or equal to upload_max_filesize post_max_size = 100M I had 10M before and was trying to upload a 40M video..
-
My bad the cropping functionality works... I didn't recognized (again..) the Apply button on the left corner xD.
-
Thanks for you quick Answer @kongondo I'm testing the media manager at the moment on localhost with a blank processwire install 1. Uploading Videos: .mp4 is specified as an allowed extension. I looked into the console and I am getting this error from the ajax call: 2. Editing Tags Thanks. I enabled now the tags for the media manager fields. It works now. 3. Variations For cropping I am using 'save as copy'. It just makes a exact copy of the origin image and afterwards it looses the original one. The same happens when I save(save as copy) the image with the original dimensions. 4. Uploading Images/Videos I'am uploading all the files from the upload tab in the media manager module (jqueryfileupload).
-
Saving Variatons in different Dimension works... I didn't recoginzed the radios.... My bad But when I save a variation with the same dimensions it still looses the original. PS: But the cropping functionaliy also doesn't work. It just copy the original one and looses the original afterwards.
-
Hi @kongondo Our Agency has purchased your Media Manager which is great Module. But I encountered a few Bugs/Problems. On localhost (ProDraft, Multilanguage Fields respectively the multilange installation profie of processwire): 1. Can't upload Videos 2. Cant change or edit Tags field (it always stays empty no matter what i do). 3. The variations problems is also active here General Problems on Server (Uses Different Hooks, ProDraft, Multilanguage Fields etc...): 1. Cant change or edit Description field (sometimes it works once). 2. Cant change or edit Tags field (it always stays empty no matter what i do). 3. Variations functionality(cropping, changing dimensions etc...) doesnt work (It just makes a exact copy with the same dimensions and adds it to the file/image field of the page) When I upload the image When I use the variations functionality Don't know if this is usefull for debugging (All Hooks): $this->addHookBefore('ProcessHome::execute', $this, 'rootPage'); $this->addHookAfter("Page::editable", $this, 'setEditAccess'); $this->addHookAfter("Page::addable", $this, 'setAddAccess'); $this->addHookAfter("ProcessPageLister::getSelector", $this, 'setListerAccess'); $this->addHookAfter('ProcessPageList::execute', $this, 'hidePages'); $this->addHookBefore('ProcessPageAdd::executeTemplate', $this, 'redirectParent'); $this->addHookAfter('ProcessPageListRender::getPageLabel', $this, 'addTemplateLabel'); $this->addHookAfter('ProcessPageAdd::buildForm', $this, 'addFields'); $this->addHookAfter('ProcessPageAdd::buildForm', $this, 'collapseName'); $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addLangViewTabs'); $this->addHookAfter('ProcessPageEdit::getTabs', $this, 'removeDefaultViewTab'); $this->addHookAfter('InputfieldForm::render', $this, 'renderForm'); $this->addHookAfter('ProcessPageAdd::execute', $this, 'addScript'); $this->addHookBefore('WireMail::send', $this, 'fixOutlookMail'); $this->addHookAfter('Pages::save', $this, 'hookSave'); $this->addHookAfter('Pages::clone', $this, 'hookClone'); When I deactivate all Hooks the Problems are still there. PS: I deactivated the draft functionality for the media manager templates.
-
Your assumption is right. I tested it and logged the ajax calls in the pagetree: At the first I'm opening some branches inside the page. It has made some logs since the pagetree is called from ajax: But after refresh and navigating (the branches are still in open state) to other pages and back to tree, the log file hasn't changed since it hasn't occured an ajax call (tree cached like you said) . So the hook doesn't return the altered pagetree since the statement is false. Therefore I think the 2 gist codes you linked will probably not work since it is also called inside an ajax-check. I will give a look at your module, perhaps I can make it work with it. Greetings Orkun
-
Thanks for your answer @adrian I tried it with addHookBefore and now it doesn't work at all. How does your code looks like? Are you also using the code from Soma? Didn't knew that PW 3 is caching the Page Tree perhaps you are right about the ajax check . I have now tried an another method which ryan mentioned here. This works now so far I can tell, but it is much much slower than the json method. $this->addHookAfter("Page::listable", $this, "hookListable"); // getPacesToExclude() function returns the pages i want to hide public function hookListable(HookEvent $event){ $page = $event->object; if($this->getPagesToExclude()->has($page)){ $event->return = false; } }
-
Hi fellows I have a problem with one of my hooks in processwire 3. It's a hook which manipulates the processpagelist to only show the pages which are not editable and not addable. This works fine in 2.7.3 but in pw 3 it doesn't work 100%. When the first time the ProcessPageList is rendered the hook works. Now when I open a branch and reload then it shows all pages. but when i close the branch before reload it works again and only shows the pages which are editable or addable. How it should look like: How it looks when i let the branch open and reload: PHP-Code $this->addHookAfter('ProcessPageList::execute', $this, 'hidePages'); public function hidePages(HookEvent $event){ $excludePages = new PageArray(); $the_pages = wire('pages')->find("template=newsletter-clinic|sender_2016|sender_2016_collab|inside-news-folder|event-clinic"); foreach ($the_pages as $the_page) { if(!$the_page->editable() && !$the_page->addable()) { $excludePages->add($the_page); } } $hidden = explode('|', $excludePages); if($this->config->ajax){ // manipulate the json returned and remove any pages found from array $json = json_decode($event->return, true); foreach($json['children'] as $key => $child){ if(in_array($child['id'],$hidden)) unset($json['children'][$key]); } $json['children'] = array_values($json['children']); $event->return = json_encode($json); } } Do you perhaps know what causes this and how to fix this?
-
@kixe Somehow the language only changes for the Datepicker but not for the timepicker.
- 13 replies
-
- timepicker
- addon
-
(and 2 more)
Tagged with:
-
Thanks @pwired. I looked around and it looks like that Symfony and Zend are widespreaded in Switzerland. I've heard about it. It is a nice collection of tutorials for Beginners and Advanced Developers. Thanks for mentioning it @LostKobrakai.
-
Hi Guys Do you have any Recommendations to learn a PHP-Framework as a Junior Developer or better said what would you suggest that I should learn as my first full blown PHP-Framework? Since there are so many PHP-Frameworks outhere I don't really know which I should start learning. Because of this I am asking the ProcessWire Community which is full of experienced Developers. What are the Frameworks you used (and are still using) over the years to build custom web-apps (besides ProcessWire )? The Reason I want to learn a new PHP-Framework is simple - I want to improve my skills and add new ones to it . Greetings Orkun aka "Nukro"
-
LOL, how could I miss that!