IRC logs

20150219

Logs from channel #fedext on freenode - our official support channel.

IRC log range: 20150219*

20150219

  • 03:44:44 <denisdroid> Good morning guys.
  • 03:45:22 <denisdroid> Does anyone know of a way to generate the encryption key for TYPO3 programatically? (not in the install tool with the GUI)
  • 04:03:50 <shaggz> Hey guys
  • 04:05:27 <shaggz> I got a strange problem. I'm using flux 7.1.2, fluidpages 3.1.2, fluidcontent 4.1.1 and vhs 2.2.0
  • 04:06:22 <shaggz> I added a Content Element and now the element is visible in the plugins tab although I specified, that it should go to the FCE tab
  • 04:07:27 <shaggz> The next thing is that I have an additional element line with broken image (icon) and of course no item text
  • 04:08:09 <shaggz> Did somebody have similar problems?
  • 04:44:04 <bjo3rn> shaggz this is typically caused by some syntactical error in a template.
  • 04:44:41 <shaggz> I'm making a new try, maybe that works
  • 04:45:19 <bjo3rn> or install ext:builder and let it check your templates.
  • 04:45:34 <shaggz> I have it installed
  • 04:45:38 <shaggz> wait a sec
  • 04:47:14 <shaggz> Builder says that everything is fine :/
  • 04:47:18 <shaggz> -.-
  • 04:47:26 <shaggz> That's kind of weird
  • 04:48:07 <bjo3rn> I won't ask the infamous 'cleared the cache' question ^^
  • 04:48:23 <cedricziel> my magic glassbowl tells me we didnt see code yet
  • 04:48:28 <bjo3rn> woosh
  • 04:48:37 <bjo3rn> but builder did
  • 04:48:56 <bjo3rn> brb
  • 04:54:32 <shaggz> Here's the gist for my template https://gist.github.com/tkasper/91fba32c85560850d178
  • 05:45:27 <shaggz> Another problem I recognize is that my changes are not visible. I have to uninstall and then install the extension again. And I have set the configuration "Disable Fluid caching of Flux forms"
  • 05:59:43 <cedricziel> are you in production mode?
  • 06:00:07 <cedricziel> the fluid cache gets reloaded in development context
  • 07:36:31 <shaggz> @cedricziel I set basic.debugMode to 1 (flux configuration)
  • 07:36:59 <shaggz> Thought that this should be sufficient
  • 08:48:35 <s-andersen> I'm trying to assign a custom variable to my template in my provider extension, but I can't figure out how to do it. Have tried following this page, but get a "Cannot redeclare pagecontroller": https://fluidtypo3.org/documentation/templating-manual/advanced-provider-extensions/custom-flux-controllers/controller-actions.html
  • 08:53:30 <cedricziel> shaggz: Development Context is for development. Production is for .. well. Production.
  • 08:56:52 <cedricziel> Uhm. How does your controller look like, s-andersen?
  • 09:03:26 <s-andersen> cedricziel: I think the problem was the way I registered my provider extension in ext_tables.php
  • 09:03:43 <cedricziel> so it's solved by now?
  • 09:04:09 <s-andersen> cedricziel: No not completely, because now I get: Template could not be loaded. I tried "/var/www/jvk.dk/ny/web/typo3conf/ext/flux/Resources/Private/Templates/Page/Default.html"
  • 09:04:47 <s-andersen> Do I have to call the render() function in my pagecontroller?
  • 09:06:50 <s-andersen> cedricziel:This is what my controller looks like: http://pastebin.com/cbQvqnCd
  • 09:10:30 <cedricziel> Interesting. This shoud run in your extensions scope.
  • 09:10:42 <cedricziel> NamelessCoder knows best around custom controller.
  • 09:11:24 <cedricziel> btw. grabbing raw request parameters wont significantly improve your security
  • 09:34:48 <NamelessCoder> success.
  • 09:47:32 <jmverges> hi there fellas
  • 09:49:49 <s-andersen> Is there another way to assign a simple variable from PHP to a fluid template, than to make a controller in the provider extension.
  • 09:50:56 <NamelessCoder> hey jmverges
  • 09:51:06 <jmverges> hello NamelessCoder
  • 09:51:14 <NamelessCoder> s-andersen controller or ViewHelper
  • 09:54:53 <s-andersen> NamelessCoder: I have tried making a controller, looks like this: http://pastebin.com/cbQvqnCd
  • 09:55:51 <s-andersen> With the function I get an error about the template, but if I remove the function the page renders without error.
  • 09:55:57 <NamelessCoder> s-andersen you should extend PageController from fluidpages
  • 09:56:07 <NamelessCoder> a table name is required
  • 09:56:22 <NamelessCoder> plus some other circumstances which are taken care of by PageController to make it perfect for pages
  • 10:00:08 <s-andersen> NamelessCoder: something like this: http://pastebin.com/uSbnMDqW
  • 10:00:31 <s-andersen> Returns no error, but it seems the function is not called.
  • 10:00:54 <NamelessCoder> hmm now it's a viewhelper, not a controller
  • 10:01:23 <NamelessCoder> or rather a controller placed in the viewhelper scope
  • 10:01:43 <NamelessCoder> the things you should do, in order:
  • 10:02:11 <NamelessCoder> 1) General note: you should use another vendor name than FluidTYPO3 and you should include this other vendor name in the calls to register your provider
  • 10:02:59 <NamelessCoder> 2) Your controller should be YourVendor\Newjvk\Controllers\PageController and should extend FluidTYPO3\Fluidpages\Controller\PageController
  • 10:03:34 <NamelessCoder> 3) Your action should be public (but it technically does not have to be)
  • 10:05:00 <NamelessCoder> 4) Your template file and action should not be named "ProductID" and "productID" respectively. The uppercase "ID" part may mess with detection. UpperCamelCase is the appropriate template file naming (e.g. ProductId.html) and lowerCamelCase is appropriate for controller actions (e.g. productIdAction).
  • 10:05:29 <NamelessCoder> 5) Your controller uses a raw GET argument; this should be left to the argument mapping of Extbase.
  • 10:06:29 <NamelessCoder> 6) Your controller may, in a broader perspective, make more sense as an actual plugin that you insert on a page, rather than an emulated page template. It looks like you will be needing argument mappings and appropriate contexts, which means a proper plugin context is preferable.
  • 10:07:18 <NamelessCoder> formalities: your controller action has @return integer which is incorrect. It should @return void.
  • 10:07:44 <NamelessCoder> and your file uses a closing php tag which is no longer allowed according to the TYPO3 CGL.
  • 10:08:01 <NamelessCoder> that should be everything, with medium detail ;)
  • 10:08:18 <gbod> Hope that author's name in annotation is right. :D
  • 10:09:08 <NamelessCoder> there's a LOT of side stuff to do with controllers ;)
  • 10:12:29 <s-andersen> NamelessCoder: Thank you for you elaborate explanation. I began with a viewhelper, then thought a controller would be the better choice. I then mixed up the code in my editor and put the wrong thing on pastebin :)
  • 10:12:40 <s-andersen> gbod: The authors name seems to be the only thing that is correct :)
  • 10:13:13 <NamelessCoder> s-andersen I guessed that you were experimenting a bit ;)
  • 10:15:15 <NamelessCoder> s-andersen I think that in the end, you will be happier with a proper plugin that renders your product info. You can, if you want to, limit the allowed CTypes in the fluidpages template so your product template is only allowed to contain for example your list or detail plugin.
  • 10:16:33 <s-andersen> NamelessCoder: Am I getting close: http://pastebin.com/ZjfUPki8
  • 10:16:43 <NamelessCoder> I've been doing that myself for as long as I can remember and it's the way that causes least "crap, have to rethink/redo that"-moments during developent
  • 10:17:16 <NamelessCoder> looks much better
  • 10:17:40 <NamelessCoder> when you register the provider extension in ext_* files, use 'JVK.Newjvk' as extension key
  • 10:17:51 <s-andersen> Yep, I have already done that.
  • 10:18:09 <NamelessCoder> your template file should then be Page/ProductList.html
  • 10:18:18 <s-andersen> The code where I extended the AbstractFluxController provoked an error, so somehow my function got called. But now, the function doesn't seem to get called.
  • 10:18:35 <s-andersen> That's also correct
  • 10:19:20 <NamelessCoder> s-andersen the problem when you only extend the basic controller class is that you will lack the tablename and fieldname properties that connect your Provider to the controller. You would either get no Provider in $this->provider or an incorrect one.
  • 10:19:56 <NamelessCoder> alright - assuming the registration is okay and you've got template paths right, your controller should work
  • 10:20:57 <s-andersen> I have \FluidTYPO3\Flux\Core::registerProviderExtensionKey('JVK.Newjvk', 'Page');
  • 10:21:05 <NamelessCoder> looks good
  • 10:21:19 <s-andersen> And template path is Resources\Private\Templates\Page\ProductList.html
  • 10:22:09 <NamelessCoder> also correct, if that is the path you defined in TS or you did not define any path
  • 10:22:54 <NamelessCoder> controller file is in Classes/Controller/PageController.php?
  • 10:23:29 <s-andersen> TS is templateRootPath = EXT:newjvk/Resources/Private/Templates/
  • 10:24:17 <s-andersen> Yes the file is in Classes/Controller/PageController.php
  • 10:25:12 <NamelessCoder> everything so far sounds good
  • 10:25:38 <s-andersen> That's weird
  • 10:25:54 <NamelessCoder> if you select ProductList as template to use on a page, your controller should be called. But make sure you return something more than an integer or Extbase may see it as an empty result
  • 10:27:14 <s-andersen> ProductList is selected and the template is rendered, but the variable I assign is not displayed. And if I place a die() function in the code, the template still renders. Seems like the function is not processed
  • 10:27:57 <s-andersen> NamelessCoder: My bad
  • 10:28:12 <shaggz> Hey NamelessCoder, I have a problem that my provider extension does not recognize changes like adding a new content element template. I set basic.debugMode to 1 (development) but I have to uninstall and reinstall the extension.
  • 10:28:14 <s-andersen> I had some "returns" from my viewhelper attempt
  • 10:28:49 <shaggz> I created the provider extension using the builder extension. Is there anything I have to register manually?
  • 10:29:34 <shaggz> In former version I just had to add a new html file but that does not work this time and I use the newest versions of flux, fluidcontent etc
  • 10:30:45 <s-andersen> NamelessCoder: Thank you for your help!
  • 10:32:21 <NamelessCoder> you're welcome, hope it works!
  • 10:33:13 <NamelessCoder> shaggz you probably either need to clear the system cache or there's some error in your template.
  • 10:33:26 <NamelessCoder> fluidcontent caches pageTSconfig in the "system" group
  • 10:34:07 <shaggz> I tried to clear general caches and manually cleared typo3temp/Cache/*
  • 10:34:19 <shaggz> Shouldn't that be sufficient?
  • 10:34:49 <shaggz> And the fact that if I uninstall and reinstall the provider extension seems a bit weird to me
  • 10:35:10 <shaggz> If I check the provider extension via the builder extension no error is shown
  • 10:55:40 <NamelessCoder> shaggz no, that won't be sufficient. The "system" group has to be cleared and that doesn't happen in either of those actions
  • 10:56:02 <NamelessCoder> it does when you (un)install extensions that ask to clear cache, and when you clear caches through the install tool
  • 10:56:26 <NamelessCoder> the option appears if you are in Development context but you can also add it in other contexts, per be user
  • 10:56:51 <shaggz> I'm sorry, at the moment I don't know where I can clear that cache
  • 11:01:10 <shaggz> Ok I set it manually in tsconfig of my user
  • 11:01:13 <shaggz> Thanks :)
  • 11:01:19 <shaggz> That saves a lot of time
  • 11:01:23 <NamelessCoder> yep, that also works on Production
  • 11:01:42 <NamelessCoder> the LLL caches are also in that group btw
  • 11:02:49 <shaggz> But when you talk about Production and Development, do you mean the configuration of the flux extension?
  • 11:03:34 <shaggz> Because there I have set it to Development. I'm pretty new to TYPO3 6.2 so maybe I need to get more into it
  • 11:04:16 <NamelessCoder> no, I mean the TYPO3_CONTEXT environment variable
  • 11:04:33 <NamelessCoder> it's a short way to configure how caches behave, among other things
  • 11:06:24 <shaggz> Okay I will read about it, thanks for the hint :)
  • 11:06:43 <NamelessCoder> - definitely worth knowing if you're doing typo3 ;)
  • 17:19:13 <s-andersen> Has anyone else experienced that a controller of a provider extension is only called when a BE user is logged in?