Jump to content

Orkun

Members
  • Content Count

    226
  • Joined

  • Last visited

Community Reputation

74 Excellent

About Orkun

  • Rank
    Sr. Member
  • Birthday 10/10/1996

Profile Information

  • Gender
    Male
  • Location
    Switzerland

Recent Profile Visitors

3,830 profile views
  1. Nevermind solved it by deleting the Row inside the table "Fields" and also deleted the Table "field_event_dates". Kind Regards Orkun
  2. Hi Guys I have a problem with a repeater field. Some weeks ago I had exported a repeater field from a dev installation and then imported it to a live installation. All just had worked fine as I remember (the field was created etc...). But today I got an email from the developer of our customer that he has a problem with two repeater fields. When he had changed the fields of another repeater it has also changed it in the other repeater field (which I had imported some weeks ago). I investigated this further and found out that exporting/importing of repeater fields doesn't work for my version of processwire (we are using 2.7.3) (see https://github.com/processwire/processwire-issues/issues/416). So I decided to remove the repeater field and create it again manually on the live enviroment. I could remove the repeater field from the template but I can't delete the repeater field because it is referring to a false repeater template. How can I fix this issue so that I can delete the repeater field? The "event_dates" repeater field is referring to the "repeater_speciality_adresses" template which is wrong. When I try to delete the field I get this error: Do I need to manually remove the field from the db? What do I exactly need to do? Kind Regards Orkun
  3. Thanks @dragan I had solved this with a hook into the processInput of the corresponding Inputfield. It kinda feels dirty but it does the job. It checks at first if all languages are empty. If all languages are empty, it gets the old values of the page and gives the data to the incoming post request, so that the old values are still in place. And also an error message is returned on the field. $wire->addHookAfter("InputfieldPageTitle::processInput", function(HookEvent $event) { if(wire('user')->hasRole("partner")){ $field = $event->object; $page = $this->modules->ProcessPageEdit->getPage(); $allowedTemplates = array( "event", "partner", ); if(in_array($page->template->name, $allowedTemplates)){ $errorCounter = 0; foreach($this->languages as $lang){ $lname = $lang->isDefault() ? "" : "__".$lang->id; if($this->wire('input')->post("title$lname") == ""){ $errorCounter++; } } // If all multi-language Fields are empty if($errorCounter == 4) { // Needs to be done like this for the default language. Somehow id doesn't work inside the foreach loop underneath $default = $this->languages->getDefault(); $oldvalue = $page->getLanguageValue($default, 'title'); $field->value = $oldvalue; // iterate through all languages except default foreach($this->languages as $lang){ if(!$lang->isDefault()){ // Get value which is already in db / on page $oldvalue = $page->getLanguageValue($lang, 'title'); // Overwrite incoming post with old data from the db $postvar = "title__{$lang->id}"; $this->wire('input')->post->$postvar = $oldvalue; } } // Populate Error to field $field->error("You must fill in at least one language"); } } } }); $wire->addHookAfter("InputfieldTextarea::processInput", function(HookEvent $event) { if(wire('user')->hasRole("partner")){ $field = $event->object; $page = $this->modules->ProcessPageEdit->getPage(); $allowedTemplates = array( "event", "partner", ); $allowedFields = array( "body", "about_us", "why_we_join" ); // If field is already required, abort the hook if($field->required) return; $f = $this->wire('fields')->get($field->name); if(in_array($page->template->name, $allowedTemplates) && in_array($field->name, $allowedFields) && $f instanceof Field && $f->type instanceof FieldtypeLanguageInterface){ // Check if field is empty in all languages $errorCounter = 0; foreach($this->languages as $lang){ $lname = $lang->isDefault() ? "" : "__".$lang->id; if($this->wire('input')->post("{$field->name}$lname") == ""){ $errorCounter++; } } // If all multi-language Fields are empty if($errorCounter == 4) { // Needs to be done like this for the default language. Somehow id doesn't work inside the foreach loop underneath $default = $this->languages->getDefault(); $oldvalue = $page->getLanguageValue($default, $field->name); $field->value = $oldvalue; // iterate through all languages except default foreach($this->languages as $lang){ if(!$lang->isDefault()){ // Get value which is already in db / on page $oldvalue = $page->getLanguageValue($lang, $field->name); // Overwrite incoming post with old data from the db $postvar = "{$field->name}__{$lang->id}"; $this->wire('input')->post->$postvar = $oldvalue; } } // Populate Error to field $field->error("You must fill in at least one language"); } } } }); Kind Regards Orkun
  4. Hi Guys My Processwire Installation has 4 Languages installed (German, French, Italian and English). German is the default language. How can I change the behavior of a required Multi-Language Field, that it checks if one of the lanuages is filled out (and not how it is like now where it only checks, if the default language is filled out)? Do I need a Hook for this or some js action? Kind Regards Orkun
  5. Just tested it on DEV Site. Works like a charm. Thank you!
  6. Hi Guys How can I make a redirect inside the .htaccess to my custom maintenance.html file when any URL of my Website is accessed except the processwire admin (www.example.com/processwire/). Because I want that my User's still can access the website when they are loggedin in Processwire. When the current url starts with /processwire or if there is a processwire-login-cookie (Is there a cookie when user is logged in Processwire?) available the redirect should not work. Otherwise it should work. How can I achieve this?
  7. Hi Guys Working now for several years with Sublime Text and lately I had made the decision to try out vscode and I must say that it is really cool. Feels really fast like Sumblime Text. I have a question about the code syntax highlighting. How can I say to vscode that it should treat *.module files as *.php files so that syntax highlighting of php is used for Modules? Edit: Nevermind - https://stackoverflow.com/questions/29973619/how-to-make-vs-code-to-treat-other-file-extensions-as-certain-language Kind Regards Orkun
  8. Hi @kongondo Sorry for my late answer. I could resolve the issue with renaming the audio pagename from "peter-fractures-lac" to "peter-fractures-lac-old" after I have done that somehow a new page was generated automatically called "peter-fractures-lac" with the same audio file like the "old" page ("peter-fractures-lac-old"). From now on I could upload images documents etc... and it worked fine. The Error "Empty file upload result" doesn't come anymore. I also removed now the new generated audio page and renamed "peter-fractures-lac-old" back to "peter-fractures-lac" and everything still works fine. Very strange behavior. - It was working OK previously I upgraded to 0.0.6 now. Thanks. Kind Regards Orkun
  9. Hello @kongondo Our users are getting the error "Empty file upload result" when trying to upload images, documents etc... But the image still gets uploaded successfully. After that i checked with Chrome dev tools the ajax response when uploading the placeholder image: I get this error: I searched for that page "peter-fractures-lac-37499" but only found the page "peter-fractures-lac". But it is a media manager audio page. It looks like the module is trying to create a new mm-audio page called "peter-fractures-lac" but since there is already a page with the same name this error happens. But the question is why is he trying to create a audio page when I am uploading an image? Processwire Version: 2.7.3 dev MediaManager Version: 0.0.9 JqueryFileUpload Version: 0.0.2 PHP-Version: 7.0.32 Kind Regards Orkun
  10. Hi Guys I don't know what I am doing wrong. I have a website with three languages. German (default), French and English. The homepage should be only visible on the default language. So i removed the check on french and english: But some children pages of home are active in the french and english language. Let's say I am on a children page in the french language, for example www.example.net/fr/lorem/. When I click on the Logo (linked to home) it redirects as expected to www.example.net/fr/ and outputs the content of 404 Error Page. What can I do, so that it redirects to the default version of home and not to a 404 Error site. I pasted this code to my home template but it only works when I am logged in: if(!$page->viewable($user->language)){ $session->redirect($page->localUrl($languages->getDefault())); } I have also tried to catch it with a Hook on ProcessPageView::pageNotFound: // hook on 404 page to render custom content or redirect $this->addHookAfter("ProcessPageView::pageNotFound", $this, "hookPageNotFound"); protected function hookPageNotFound(HookEvent $event) { $url = trim($event->arguments("url"),"/"); $page = $event->arguments("page"); // it seems when page is unpublished, we have no "url" from page not found hook if($page->is("unpublished")){ $url = $page->url; } // shortcut urls catch, if a page with "shortcut" matches requested url // we redirect to that page, sinmple and easy if($url) { wire('log')->save("test", $url); } } But www.example.net/fr/ doesn't trigger the hook... What I am doing wrong?
  11. Hi Guys Last time I got a psd file from a customer. I needed the Images from the psd file but I hadn't photoshop or gimp installed on my system (and I also don't wanted them to have since I don't like them). So I quickly searche a online tool where I could extract the images from the psd file and I found pretty fast https://studio.psdetch.com/. It worked great for me. I could select any image in the psd file and extract it with a click of a button, pretty easy. It looks like it has also some other features but I don't looked at it in detail. Hope this helps some of you. Greetings Orkun
  12. Hi Guys I am writing this topic to help others who also encountered this problem. Two days ago our customer wanted to have new Roles for their Translators. The new Users / Roles shouldn't have write access to the default language (german) tab of the multilanguage fields but for all other languages (french and english) they should have it. So I made a little research and found Language Page Edit Permission. I created three new permissions (page-edit-lang-default, page-edit-lang-en, page-edit-lang-fr). I gave this new language permissions to all of my other roles in the system which had page-edit permissions. After that I created a new "translator" role and gave it only the page-edit-lang-en & page-edit-lang-fr permissions. And it worked out great. The Translator Users could only edit the french and english tab of the multilanguage fields. So far so good. But after 1 day I got a call of one of the customers employees (editors role). They said, that they couldn't create any pages anymore. So I looked into the related role and template permissions and all looked good. So after some trial and error I found out the solution. The Parent Page -> Template (where normally the new created pages are living) needs also edit permissions and not only "add children" permission if you have installed language page edit permissions, so that the users can create pages again. I'dont know if this is a bug or if it's intend to be so. I was using Processwire Version 2.7.2. Greetings Orkun
  13. Hi Guys We are looking for an alternative to MailChimp for managing Newsletters, Subscribers, Campaigns, Lists etc... While searching for a new Tool I discovered Sendy. It looks like a decent Webapp/Newsletter-Tool to manage Newsletters, Lists, Subscribers, Campaigns etc... The Mails are sended with Amazon SES and it is way cheaper than Mailchimp. And it is also a self hosted Tool. Has someone some Experience and Opinions on Sendy in general and also in combination with ProcessWire (Module, Integration etc...)? Do you also know other Solutions / Alternatives rather than Mailchimp? Kind regards Orkun
  14. Orkun

    Portfolio Website

    Nice site. Really like the minimalism.
  15. Hi @kongondo I previously encountered an error in the media manager because of a javascript section in ProcessMediaManager.js. This Code closeDialog = function(s=1000) { setTimeout(function() { //$('div.ui-dialog-titlebar button.ui-dialog-titlebar-close').click(); parent.jQuery('iframe.ui-dialog-content').dialog('close'); }, s); } cause this error on IE and older Safari Versions (9.1.2, It worked though in newer versions -> 11.1) for me: Because of this error the Media Manager doesn't worked correctly anymore (JS didn't function right like mm_top_panel was hidden etc...). I fixed it with changing it to this: closeDialog = function(s) { /*temporary fix*/ if(s === undefined){ s = 1000; } setTimeout(function() { //$('div.ui-dialog-titlebar button.ui-dialog-titlebar-close').click(); parent.jQuery('iframe.ui-dialog-content').dialog('close'); }, s); } Just wanted to draw attention to it since other people could also have this problem. I am using an older Media Manager Version (9.0) so please don't mind if this problem is already fixed in the newer versions of the module. Kind regards Nukro
×
×
  • Create New...