Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repair categories feature #195

Closed
qazjayp opened this issue Apr 7, 2016 · 11 comments
Closed

Add repair categories feature #195

qazjayp opened this issue Apr 7, 2016 · 11 comments
Assignees
Labels
Priority: Low Issue / PR that in theory would be accepted, but maintainers aren't planning on working on it Status: Abandoned Has not seen any activity in at least a month, used to prompt stakeholders to action Type: Enhancement Proposed enhancement that has been accepted / implemented

Comments

@qazjayp
Copy link

qazjayp commented Apr 7, 2016

My website is down out of the blue (blog version 1.2.2 )

Illegal operator and value combination.

Where('nest_left', '>=', null)

56 Illuminate\Database\Query\Builder->where(…)
55 call_user_func_array(…) ~/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php 526
54 Illuminate\Database\Eloquent\Builder->where(…) ~/vendor/october/rain/src/Database/Traits/NestedTree.php 357
53 RainLab\Blog\Models\Category->scopeAllChildren(…)

@daftspunk
Copy link
Member

What database engine are you using? Did you upgrade anything at all?

@qazjayp
Copy link
Author

qazjayp commented Apr 7, 2016

mysql.

No nothing updated at all.

On 07/04/2016 11:05, Samuel Georges wrote:

What database engine are you using? Did you upgrade anything at all?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
http://email.sidekick.org/c/eJxFj71yhDAMhJ8GumNkS7JRQXEp8h7-Bc9xwGAo8vbxXIpottiv2B1tnHQYwfZlYgsGjaEBQQOB6QhqielVwmvYz7lfJstJXFKik2X0ZFxm5yIpQWsseezXabmuo3b47PR301yu5fZD2N8NTle21fnm_LrPj2O957I1KrXeqTajhDuNH2yJd9quhwZjhQShP6czHetPp78AMNvMiVGrRAgUI3JAMl6Us95AksDsSAyoMTKJDhn-TilUMSO0CU4ZCQlGHyxkaVs_9cP_x7_NWFGx

@daftspunk
Copy link
Member

Try this php artisan tinker

Paste in

foreach (RainLab\Blog\Models\Category::whereNull('nest_left')->get() as $category) {
    $category->setDefaultLeftAndRight();
    $category->save();
}

@qazjayp
Copy link
Author

qazjayp commented Apr 7, 2016

I get this from Tinker

php artisan tinker
PHP Fatal error: Cannot use PhpParser\Node\Scalar\String as String
because 'String' is a special class name in
/home/forge/lifestyleproperty.co.uk/vendor/psy/psysh/src/Psy/CodeCleaner/MagicConstantsPass.php
on line 19

[Symfony\Component\Debug\Exception\FatalErrorException]
Cannot use PhpParser\Node\Scalar\String as String because
'String' is a special class name

On 07/04/2016 11:33, Samuel Georges wrote:

Try this |php artisan tinker|

Paste in

|foreach (RainLab\Blog\Models\Category::whereNull('nest_left')->get()
as $category) { $category->setDefaultLeftAndRight();
$category->save(); } |


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
http://email.sidekick.org/c/eJxFjztyhTAMRVcD3WNk-auCIimyD8uWwfN4wPApsvt4aKJRcU8hzbl5xBTA93W0HpwmwEGDBwDfGThrlndN72E7pn4egw6YEUh0pkgIkrVFE4oTAwUg9cs4X9d-dvqrw5-2U73mm4e0fRocsa5L5JZ42abXvtxTXRvV87zlbEGR7VA_2C4-sl4vBBcAvXX9MR6yL78dfgPo4osV6wNzMyZFnqN1ZH0UUeAi21BM5siGnbGEqck9o5RWuZBjwqgcJYHAyUOh1vV5P_wb_wHRAFKC

@daftspunk
Copy link
Member

Try putting it on a page with this PHP code

function onStart()
{
foreach (RainLab\Blog\Models\Category::whereNull('nest_left')->get() as $category) {
    $category->setDefaultLeftAndRight();
    $category->save();
}
}

Then open that page

@qazjayp
Copy link
Author

qazjayp commented Apr 7, 2016

This link: http://email.sidekick.org/c/eJwljjuOwzAQQ09jl8JIY_0KFZsAew99ZmLBXtiQlcK3XyEhWJEA-UpQ2YGda9AWDD6eRhjwYAGnBa5aaKt5E0d7zWvQmBOzWpyJhZkI9YKMiykcHWmy8x7W3s9rwp9J_Q7vlenq905nO05q_Rb5EO9tNH3kcwuNzv2e1AMA2bImrxMhDyCEbJ3TOsqcosukVIm-FGmk9YPNq8zwlZQoCyevvYrS-EzgUrbAfvB_5sWr9vWdxvXfP8swRw8

saved this:

function onStart() {

 echo 'called';

 $test = RainLab\Blog\Models\Category::whereNull('nest_left')->get();
 print_r($test->all());

 foreach 

(RainLab\Blog\Models\Category::whereNull('nest_left')->get() as $category) {
$category->setDefaultLeftAndRight();
$category->save();

 }

}

On 07/04/2016 11:42, Samuel Georges wrote:

Try putting it on a page with this PHP code

|function onStart() { foreach
(RainLab\Blog\Models\Category::whereNull('nest_left')->get() as
$category) { $category->setDefaultLeftAndRight(); $category->save(); } } |

Then open that page


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
http://email.sidekick.org/c/eJxFj7uOhDAMRb8GukG2Qx4uKHZWmv9InASiYQDxKObvN6JZy8U9ha1z40DiwLZl0BaMev6azgCDBdX0cJSY3kXe3bqP7TRgBEIfuTd91hnA2AyS0ZqkoFeS2nmYznM7GvXT0KvuWM7pCp2snwq7L8vsQ01hXsfHNl9jWSqV47jSUQOybkjdWC8-aTkfBMaBJovtPuxpm78NPQFUtlkn1iGpXOUViHVOa48SvJNEFD3HiAYt1x5MUl3vQVQYc2DN5NGwJHBBLGSuXe_33b_xHyCUUrs

@daftspunk
Copy link
Member

Looks like it's fixed now

We may need to include a "Repair categories" function because yours somehow became corrupted

@qazjayp
Copy link
Author

qazjayp commented Apr 7, 2016

How the hell is it working now?

Did the code you provide force a fix?

Somehow?

thanks

jon

On 07/04/2016 11:52, Samuel Georges wrote:

Looks like it's fixed now

We may need to include a "Repair categories" function because yours
somehow became corrupted


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
http://email.sidekick.org/c/eJxFjztuxDAMRE9jd2tQpL6Fi02A3EOUKK-wXtvwp8jto2yKDFjMI8ABJ4-YPLi-jsaBpU9rBgUKNIROw1GzPGt6Dus-9Y-RgAFKSuSjZe2JmJzTzNbkzKrkfh4f57kdHd07_Goz1fNx8ZDWV4M91mWO3BzP63Tb5muqS6N6HJcczahgOqQ3touXLOcNwXoIaFW_j7ts83eHHwBUXDFSxEejhTQLGB3RR5HsrSJG9MVnNIF1Ni5gKvAnpUjlkkvbRWVDEvCcHJTfru_44f_jH5iGU5s

@daftspunk
Copy link
Member

Yes of course it did =)

@daftspunk daftspunk changed the title Blog stopped working. Add repair categories feature Apr 7, 2016
@daftspunk daftspunk self-assigned this Apr 7, 2016
@qazjayp
Copy link
Author

qazjayp commented Apr 7, 2016

thanks again for you help

On 07/04/2016 11:55, Samuel Georges wrote:

Yes of course it did =)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
http://email.sidekick.org/c/eJxFj7mOg0AQRL8GMqM-5uqAYFcr_wdzwcgYEEewf--xN9hSBfWCLlXHnoID25ZeWzD8I_dOgQEBaRQcJaZHCY9u3cd26p22USVvgCASM7FVHDNZIGMF2bRzP53ndjT81dC9eizndPkurM8K-1CWefA1-Xkdb9t8jWWpVI7jSkcNKLoh_mC9eKblvBEYh3WObfd-T9v829A3AGebdQKVMEH2QiwhkCg_ZDcEnbzzGhVWqYiehUKGPyEyxpzECA1oJCRwPljI718_9d3_4hdxVFH4

@daftspunk daftspunk added Priority: Low Issue / PR that in theory would be accepted, but maintainers aren't planning on working on it Type: Enhancement Proposed enhancement that has been accepted / implemented labels Aug 3, 2016
@LukeTowers
Copy link
Contributor

Closing as it has been over a month since any activity on this occurred.

@LukeTowers LukeTowers added the Status: Abandoned Has not seen any activity in at least a month, used to prompt stakeholders to action label Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Issue / PR that in theory would be accepted, but maintainers aren't planning on working on it Status: Abandoned Has not seen any activity in at least a month, used to prompt stakeholders to action Type: Enhancement Proposed enhancement that has been accepted / implemented
Projects
None yet
Development

No branches or pull requests

3 participants