I'll try with it tomorrowI will do a fresh install soon.
You tried xons multi prefix?
We'll fix that too, thanksI cant update an existing prefix.
I have deactivated XON's MultiPrefix
I have deactivated PrefixEssentials
=> no success, still get that error
I have searched for$form->basicEntitySave($prefix,
in a lot of addons,
but cant find anything.
If i search forsaveAdditionalData
i find a lot of functions, but they dont work withbasicEntitySave
I dont need any robots-stuff, so i will comment// $form->basicEntitySave($prefix, $prefixRobots);
to get rid of this error.
[_values:protected] => Array
(
[prefix_id] => 178
[prefix_group_id] => 13
[display_order] => 24
[materialized_order] => 60
[css_class] => label label--primary
[allowed_user_group_ids] => -1
[tagess_tags] => a:2:{i:0;s:4:"test";i:1;s:5:"test2";}
[xs_seo_meta_robots] => noindex,nofollow
XenSoluce\SEOOptimization\XF\Admin\Controller\ThreadPrefix
$form = parent::saveAdditionalData($form, $prefix);
$form = parent::saveAdditionalData($form, $prefix);
return $form;
parent::saveAdditionalData($form, $prefix);
protected function saveAdditionalData(FormAction $form, \XF\Entity\AbstractPrefix $prefix)
{
/** @var \AVForums\TagEssentials\XF\Repository\Tag $tagRepo */
$tagRepo = $this->repository('XF:Tag');
$tagList = $this->filter('tagess_tags', 'str');
$tags = new ArrayCollection($tagRepo->splitTagList($tagList));
$tags = $tags->filter(function ($tag) use ($tagRepo)
{
if ($tagRepo->isValidTag($tag))
{
return true;
}
return false;
});
if ($tags->count())
{
$tagsArr = $tags->toArray();
$existingTags = $this->finder('XF:Tag')
->where('tag', $tagsArr)
->fetch();
/** @var \AVForums\TagEssentials\XF\Entity\Tag $existingTag */
foreach ($existingTags AS $existingTag)
{
$tagsArr = array_diff($tagsArr, [$existingTag->tag]);
}
$form->apply(function() use ($form, $tagsArr, $tags, $prefix) {
foreach ($tagsArr AS $newTagToCreate)
{
/** @var \AVForums\TagEssentials\XF\Entity\Tag $tag */
$tag = $this->em()->create('XF:Tag');
$tag->tag = $newTagToCreate;
$tag->permanent = true;
$tag->save(true, false);
}
$prefix->tagess_tags = $tags->toArray();
$prefix->save(true, $form->isUsingTransaction() ? false : true);
});
}
else
{
$prefix->tagess_tags = [];
}
parent::saveAdditionalData($form, $prefix);
}
protected function saveAdditionalData(FormAction $form, \XF\Entity\AbstractPrefix $prefix)
{
$form = parent::saveAdditionalData($form, $prefix);
/** @var \AVForums\TagEssentials\XF\Repository\Tag $tagRepo */
$tagRepo = $this->repository('XF:Tag');
$tagList = $this->filter('tagess_tags', 'str');
$tags = new ArrayCollection($tagRepo->splitTagList($tagList));
$tags = $tags->filter(function ($tag) use ($tagRepo)
{
if ($tagRepo->isValidTag($tag))
{
return true;
}
return false;
});
if ($tags->count())
{
$tagsArr = $tags->toArray();
$existingTags = $this->finder('XF:Tag')
->where('tag', $tagsArr)
->fetch();
/** @var \AVForums\TagEssentials\XF\Entity\Tag $existingTag */
foreach ($existingTags AS $existingTag)
{
$tagsArr = array_diff($tagsArr, [$existingTag->tag]);
}
$form->apply(function() use ($form, $tagsArr, $tags, $prefix) {
foreach ($tagsArr AS $newTagToCreate)
{
/** @var \AVForums\TagEssentials\XF\Entity\Tag $tag */
$tag = $this->em()->create('XF:Tag');
$tag->tag = $newTagToCreate;
$tag->permanent = true;
$tag->save(true, false);
}
$prefix->tagess_tags = $tags->toArray();
$prefix->save(true, $form->isUsingTransaction() ? false : true);
});
}
else
{
$prefix->tagess_tags = [];
}
//parent::saveAdditionalData($form, $prefix);
return $form;
}
@Xon could you have a look, please?Yes, this works for me to change the "tag essentials" like written above.
Code:protected function saveAdditionalData(FormAction $form, \XF\Entity\AbstractPrefix $prefix) { $form = parent::saveAdditionalData($form, $prefix); /** @var \AVForums\TagEssentials\XF\Repository\Tag $tagRepo */ $tagRepo = $this->repository('XF:Tag'); $tagList = $this->filter('tagess_tags', 'str'); $tags = new ArrayCollection($tagRepo->splitTagList($tagList)); $tags = $tags->filter(function ($tag) use ($tagRepo) { if ($tagRepo->isValidTag($tag)) { return true; } return false; }); if ($tags->count()) { $tagsArr = $tags->toArray(); $existingTags = $this->finder('XF:Tag') ->where('tag', $tagsArr) ->fetch(); /** @var \AVForums\TagEssentials\XF\Entity\Tag $existingTag */ foreach ($existingTags AS $existingTag) { $tagsArr = array_diff($tagsArr, [$existingTag->tag]); } $form->apply(function() use ($form, $tagsArr, $tags, $prefix) { foreach ($tagsArr AS $newTagToCreate) { /** @var \AVForums\TagEssentials\XF\Entity\Tag $tag */ $tag = $this->em()->create('XF:Tag'); $tag->tag = $newTagToCreate; $tag->permanent = true; $tag->save(true, false); } $prefix->tagess_tags = $tags->toArray(); $prefix->save(true, $form->isUsingTransaction() ? false : true); }); } else { $prefix->tagess_tags = []; } //parent::saveAdditionalData($form, $prefix); return $form; }
Does this create a bug?But you may want to view another small thing, please.
When a prefix is new and no "xs_seo_meta_robots" chosen the field
xf_thread_prefix.xs_seo_meta_robots is NULL
When you change the value to something (and save) and change it back to "Default" (and save)
the value of
xf_thread_prefix.xs_seo_meta_robots is ""
Yes, this works for me to change the "tag essentials" like written above.
Code:protected function saveAdditionalData(FormAction $form, \XF\Entity\AbstractPrefix $prefix) { $form = parent::saveAdditionalData($form, $prefix); /** @var \AVForums\TagEssentials\XF\Repository\Tag $tagRepo */ $tagRepo = $this->repository('XF:Tag'); $tagList = $this->filter('tagess_tags', 'str'); $tags = new ArrayCollection($tagRepo->splitTagList($tagList)); $tags = $tags->filter(function ($tag) use ($tagRepo) { if ($tagRepo->isValidTag($tag)) { return true; } return false; }); if ($tags->count()) { $tagsArr = $tags->toArray(); $existingTags = $this->finder('XF:Tag') ->where('tag', $tagsArr) ->fetch(); /** @var \AVForums\TagEssentials\XF\Entity\Tag $existingTag */ foreach ($existingTags AS $existingTag) { $tagsArr = array_diff($tagsArr, [$existingTag->tag]); } $form->apply(function() use ($form, $tagsArr, $tags, $prefix) { foreach ($tagsArr AS $newTagToCreate) { /** @var \AVForums\TagEssentials\XF\Entity\Tag $tag */ $tag = $this->em()->create('XF:Tag'); $tag->tag = $newTagToCreate; $tag->permanent = true; $tag->save(true, false); } $prefix->tagess_tags = $tags->toArray(); $prefix->save(true, $form->isUsingTransaction() ? false : true); }); } else { $prefix->tagess_tags = []; } //parent::saveAdditionalData($form, $prefix); return $form; }
protected function saveAdditionalData(FormAction $form, \XF\Entity\AbstractPrefix $prefix)
{
/** @var \AVForums\TagEssentials\XF\Repository\Tag $tagRepo */
$tagRepo = $this->repository('XF:Tag');
$tagList = $this->filter('tagess_tags', 'str');
$tags = new ArrayCollection($tagRepo->splitTagList($tagList));
$tags = $tags->filter(function ($tag) use ($tagRepo)
{
if ($tagRepo->isValidTag($tag))
{
return true;
}
return false;
});
if ($tags->count())
{
$tagsArr = $tags->toArray();
$existingTags = $this->finder('XF:Tag')
->where('tag', $tagsArr)
->fetch();
/** @var \AVForums\TagEssentials\XF\Entity\Tag $existingTag */
foreach ($existingTags AS $existingTag)
{
$tagsArr = array_diff($tagsArr, [$existingTag->tag]);
}
$form->apply(function() use ($form, $tagsArr, $tags, $prefix) {
foreach ($tagsArr AS $newTagToCreate)
{
/** @var \AVForums\TagEssentials\XF\Entity\Tag $tag */
$tag = $this->em()->create('XF:Tag');
$tag->tag = $newTagToCreate;
$tag->permanent = true;
$tag->save(true, false);
}
$prefix->tagess_tags = $tags->toArray();
$prefix->save(true, $form->isUsingTransaction() ? false : true);
});
}
else
{
$prefix->tagess_tags = [];
}
//parent::saveAdditionalData($form, $prefix);
return parent::saveAdditionalData($form, $prefix);
}
It is exactly the same thing, and doing an update for that is useless.1. I really dont know what is the fidderence between NULL and empty.
Maybe it is only cosmetic. But for you it is only one change for the next version "update = NULL instead "".
Yes the code changes, instead of making :2. Is there a difference in code? So i need to compare both codes now ..
$form = parent::saveAdditionalData($form, $prefix);
return $form;
return parent::saveAdditionalData($form, $prefix);
parent::saveAdditionalData($form, $prefix);
at the end of the code it was probably for a reasonI have not asked for this (i hope); but you may can do it, if and when you do the next update.It is exactly the same thing, and doing an update for that is useless.
Hello, do you have an exemple please ? Something like this ?It would be a really nice idea, if you want to care also for the meta_title of overview, please.
XFRM_resources needs to be something short for me. But the meta_title should have the usual length.
So this must be separated from each other.
xfrm_overview
with xfrm_overview_meta_title
and add the phrase.We use essential cookies to make this site work, and optional cookies to enhance your experience.