by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Nicklas Sandell
    @nicklassandell
    Does anyone have experience defining a default value generator class for a slug data type? There is no documentation for it and no information in the admin field.
    Khairi Husseini
    @khusseini
    What does the UrlSlug actually do?
    Nicklas Sandell
    @nicklassandell
    I suppose you can connect it with a controller/action and it'll handle routing for you? It exists for documents as well. But the "default value generator" can be added for any data type I just realized. Nevermind the slug stuff - I just need to figure out how to add a default value generator.
    And to more precisely answer your question - it'll generate a slug from some other data type. "Hello World" => "hello-world".
    Khairi Husseini
    @khusseini
    ah thank you for the explanation :)
    Nicklas Sandell
    @nicklassandell

    So, if anyone runs into this in the future... it was not very useful to me because the default value is only generated on creation, and not on subsequent updates. I eventually used a Calculated Data Type with a custom generator, because then it is generated upon every save. The only downside is now the user cannot override the default value. As for the Default Value Generator, this might be useful to others because there is no docs for it:

    <?php
    
    namespace NewsBundle\Generators;
    
    use Pimcore\Model\DataObject\ClassDefinition\DefaultValueGeneratorInterface;
    use Pimcore\Model\DataObject\Concrete;
    use Pimcore\Model\DataObject\ClassDefinition\Data;
    
    
    class SlugGenerator implements DefaultValueGeneratorInterface
    {
        public function getValue(Concrete $object, Data $fieldDefinition, array $context)
        {
           // Return generated default value here. You can access other fields through $object->title (for example), but they will of course be empty, as this only runs at creation.
        }
    
    }

    And in the admin, the format is like: NewsBundle\Generators\SlugGenerator

    Khairi Husseini
    @khusseini
    there's actually a ticket about the problem. maybe you can comment your solution on there as well? pimcore/pimcore#6132
    Nicklas Sandell
    @nicklassandell
    Ah yes, I stumbled across that as well actually. I didn't realize it was just a few days old as well. I left a comment there with my solution.
    JustMe69
    @JustMe69

    Hi All,
    I try to define a dynamic selection for field. The values should depend on the language of the filed.
    I defined in BE a localized field, within a selection 'ksTechnik' and set the Options Provider Class.
    My class is loaded, but I dont know how to define the result depending on the language.

    My class/getOptions():

        public function getOptions($context, $fieldDefinition)
        {
            $result = [];
            $object = isset($context["object"]) ? $context["object"] : null;
    
            if ($object !== null && $object instanceof CoreShopProduct) {
                error_log(__CLASS__ . ' ' . __FUNCTION__ . '2');
    
                $lang = $object->getLocalizedfields()->getLanguage();
                switch ($lang) {
                    case 'de_DE':
                        $result[] = ['key' => 'abc' , 'value' => 1];
                        break;
                    case 'en_EN':
                        $result[] = ['key' => 'fgh', 'value' => 4];
                        break;
                    case 'fr_FR':
                        $result[] = ['key' => 'ght','value' => 6];
                        break;
                }
            }
    
            return $result;
        }

    In the php.log I see calls of the method.
    It shows on every languag the same result, changing lang-tabs has no effect on result. The selection only shows 'abc', german is the first tab, default lang.
    How can I select the current tab-language?
    Any ideas?

    brainium
    @brainium
    Pimcore Web2Print Bundle uses PDFreactor… On the Website i can find some pricing, but in the BundleDescription i can’t find anything about additional licences. How about using this bundle in commercial cases?
    Dennis Pfahlbusch
    @dpfahlbusch_gitlab
    has someone a quick tutorial for me, how to setup the dynamic search bundle with lucene? :)
    Dennis Pfahlbusch
    @dpfahlbusch_gitlab
    or to be more specific: what would be an example request?
    Alarich
    @Alarich

    Just had an issue where a cron task was still running on php71 while pimcore upgrade took place. Somehow this caused the cronjob to start moving all objects to the root level, where they now proudly sit.

    Are there drawbacks to updating the object paths in the database to fix this? It seems to me relations are all ID based, not path based.

    Antonio Schiavone
    @gmdeantonio_gitlab
    hello, is anyone having timeout issues on startup.js? it seems that https://liveupdate.pimcore.org/update-check is still having a down ...
    lukasvitroleracc
    @lukasvitroleracc

    Hello, I am using the MembersBundle: https://github.com/dachcom-digital/pimcore-members

    I found how to use site-based mail templates: https://github.com/dachcom-digital/pimcore-members/blob/master/docs/70_EmailConfiguration.md
    But how do I use site-based twig templates for registration, check_email, check_admin etc?

    lukasvitroleracc
    @lukasvitroleracc
    so for all the different controller actions, because they all use return $this->renderTemplate('@Members/Registration/check_email.html.twig', ['user' => $user])
    But I would love to render my own templates without having to c&p the whole action into my own controllers
    Richard H.
    @sgc-fireball
    HI @ll,
    currently i create a bundle thats allow you to auto translate the multilanguage fields.
    my question is: has anyone an JS Api Admin Backend documentation?
    i am searching a way to get all multilanguage fields and after translation, i want update the values.
    via postOpenObject i extend the ExtJS Admin UI. In parameter object i found "object.data.data.localizedfields.data.<lang> = "value";" values but this isn't the current way ...
    Alarich
    @Alarich
    image.png
    How would someone filter in the Find window by relation?
    As can be seen on the demo - it doesn't seem to be working really. I'm assuming the reference to full text searches it just to represent the limitations of the system, not telling us that it's possible to use the proper markup there.
    Anyway, what I want filter on ^
    The actual use case for us would be to add products to a category based on an attribute that is a relation. Is it not possible?
    Alarich
    @Alarich
    (Drag and drop from sidebar is not a solution, there are thousands of them.)
    Manuel Reiß
    @mreiss
    Hi all
    Alarich
    @Alarich
    Hello
    Kuba Płaskonka
    @kubaplas
    @Alarich it's not yet possible, see pimcore/pimcore#699
    You can use AOS (https://github.com/pimcore/advanced-object-search) to search for objects with given relation.
    Manuel Reiß
    @mreiss

    hey :)
    I want to add new custom properties to the existing fieldDefinitions for every element (e.g. adding a few more checkboxes beside "visibleGridview", "visibleSearch"...).
    For that I think I need to extend Pimcore\Model\DataObject\ClassDefinition\Data

    Would this be the right resource for that to start with: https://pimcore.com/docs/6.x/Development_Documentation/Extending_Pimcore/Bundle_Developers_Guide/Adding_Object_%20Layout_types.html ?

    I also figured out, that the DataObject-Service implements a synchronizeCustomLayoutFieldWithMaster method. Maybe this might be also a good place to start, getting custom properties into each datafield ?

    Alarich
    @Alarich
    Thanks @kubaplas! Quick glance reveals that AOS isn't that helpful in my use case, but we have more information at least.
    Richard H.
    @sgc-fireball
    Hi, were can i find a javascript: Pimcore Object documentation?
    I want to get all Input Fields from a Data Object that i open. My target ist to build a Translation Bundle
    Kuba Płaskonka
    @kubaplas
    @sgc-fireball translation? Maybe this is similar to your needs? https://github.com/DivanteLtd/pimcore-google-translate
    Or at least you can take a look at js there.
    Stefan Hagspiel
    @solverat
    @kubaplas : Nice one! Should be also supporting deepL but I guess due to the bundle name this is a request which comes too late :smile:!
    Kuba Płaskonka
    @kubaplas
    @solverat just created an issue to add deepL ;)
    Christopher Siegel
    @christopher-siegel
    Does anyone know what pimcore uses SQIP / SVG Placeholder for exactly?
    I'm not sure if its worth it to install go & primitive for this?
    Looks like its used for the image editable when you set the lowQualityPlaceholder option to true... It says "(requires SQIP or Imagick," though... so it should be fine with just Imagick, right?
    ryanwebdev
    @ryanwebdev
    Is Pimcore's Static Route equivalent to Symfony's Routing with Annotations?
    ryanwebdev
    @ryanwebdev
    Hi I encounter problems after switching from Dev Enviornment to Prod Enviornment.
    [2020-05-28 14:22:34] request.CRITICAL: Uncaught PHP Exception ArgumentCountError: "Too few arguments to function AppBundle\Service\UrlGenerator::__construct(), 1 passed in /var/www/pimcoretest/var/cache/prod/ContainerF8QnOPx/getUrlGeneratorService.php on line 11 and exactly 2 expected" at /var/www/pimcoretest/src/AppBundle/Service/UrlGenerator.php line 13
    ryanwebdev
    @ryanwebdev

    Here is the Service in error.

    //"Generic" is an other service I created
    use AppBundle\Service\Generic;
    
    class UrlGenerator {
    
        private $router;
        private $generic;
    
        public function __construct(UrlGeneratorInterface $router, Generic $generic) {
            $this->router = $router;
            $this->generic = $generic;
        }

    and I call the UrlGenerator Service in Controller as below

    public function homeAction(Request $request, UrlGenerator $ug) {
    }

    Everything works fine in the DEV environment, but no fine in Prod Environment.

    ryanwebdev
    @ryanwebdev
    I followed this documentation to create the Services.
    https://symfony.com/doc/current/service_container.html#handling-multiple-services
    ryanwebdev
    @ryanwebdev
    another error look like this. after I swap the arguments in the UrlGenerator __construct
    public function __construct(Generic $generic, UrlGeneratorInterface $router ) {
    }
    [2020-05-28 15:05:19] request.CRITICAL: Uncaught PHP Exception TypeError: "Argument 1 passed to AppBundle\Service\UrlGenerator::__construct() 
    must be an instance of AppBundle\Service\Generic, instance of Symfony\Cmf\Component\Routing\ChainRouter given, 
    
     {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0):
     Argument 1 passed to AppBundle\\Service\\UrlGenerator::__construct() must be an instance of AppBundle\\Service\\Generic, instance of Symfony\\Cmf\\Component\\Routing\\ChainRouter given,
    ryanwebdev
    @ryanwebdev
    I found the solution for the error. Delete everything under /YOUR-PROJECT/var/cache
    Does it mean I have to clear the cache whenever a new service is created?
    Nicklas Sandell
    @nicklassandell
    @ryanwebdev that's very likely. We have it as part of our deployment script to wipe the cache on completion.
    Dominik
    @dpfaffenbauer
    @ryanwebdev when you are on env DEV, it happens automatically, when you are on env PROD, Symfony doesn’t clear it
    frintezadev
    @frintezadev
    Hello, I have an error : The EntityManager is closed. whitout any logs
    How can I get more details please ? :(
    ryanwebdev
    @ryanwebdev
    @nicklassandell @dpfaffenbauer thank you for the reply.
    Khairi Husseini
    @khusseini

    hey everyone. I am doing some custom queries on the tags_assignment table. specifically I want to execute the folllowing query:
    $tagIds = $db->fetchCol('SELECT tagid FROM tags_assignment WHERE cid IN (?) AND ctype = ?', [$ids, 'object']);

    Where $ids = [4239,3049];
    I can view the query in the symfony toolbar and when I execute it in a mysql console I get the correct tagIds, however when I run the query like I do in the line above, I get some, maybe cached value for each call (meaning a set of tags totally unrelated to the two given Ids.

    Khairi Husseini
    @khusseini
    If I replace the query with the IDs already imploded like so $tagIds = $db->fetchCol('SELECT tagid FROM tags_assignment WHERE cid IN (4329,3049) AND ctype = ?', ['object']);
    I always get the correct values. Seems like the caching mechanism doesn't check for the parameters (when they are arrays?).
    MekaKurg
    @MekaKurg
    Hello, I get this error: Call to undefined method getItems in class Pimcore\Model\DataObject\Localizedfield. But the function is listed in the documentation. Is it a bug ?
    rpicheta
    @rpicheta
    @MekaKurg have you checked this class in your vendor dir? I've checked it and there is no method in it
    MekaKurg
    @MekaKurg
    Yes, the function is no more there. In 5.4 at least, it was.